]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/llvm-objdump/llvm-objdump.h
Import DTS files from Linux 4.18
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / llvm-objdump / llvm-objdump.h
1 //
2 //                     The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
10 #define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
11
12 #include "llvm/DebugInfo/DIContext.h"
13 #include "llvm/Support/CommandLine.h"
14 #include "llvm/Support/Compiler.h"
15 #include "llvm/Support/DataTypes.h"
16 #include "llvm/Object/Archive.h"
17
18 namespace llvm {
19 class StringRef;
20
21 namespace object {
22   class COFFObjectFile;
23   class COFFImportFile;
24   class MachOObjectFile;
25   class ObjectFile;
26   class Archive;
27   class RelocationRef;
28 }
29
30 extern cl::opt<std::string> TripleName;
31 extern cl::opt<std::string> ArchName;
32 extern cl::opt<std::string> MCPU;
33 extern cl::list<std::string> MAttrs;
34 extern cl::list<std::string> FilterSections;
35 extern cl::opt<bool> Disassemble;
36 extern cl::opt<bool> DisassembleAll;
37 extern cl::opt<bool> NoShowRawInsn;
38 extern cl::opt<bool> NoLeadingAddr;
39 extern cl::opt<bool> PrivateHeaders;
40 extern cl::opt<bool> FirstPrivateHeader;
41 extern cl::opt<bool> ExportsTrie;
42 extern cl::opt<bool> Rebase;
43 extern cl::opt<bool> Bind;
44 extern cl::opt<bool> LazyBind;
45 extern cl::opt<bool> WeakBind;
46 extern cl::opt<bool> RawClangAST;
47 extern cl::opt<bool> UniversalHeaders;
48 extern cl::opt<bool> ArchiveHeaders;
49 extern cl::opt<bool> IndirectSymbols;
50 extern cl::opt<bool> DataInCode;
51 extern cl::opt<bool> LinkOptHints;
52 extern cl::opt<bool> InfoPlist;
53 extern cl::opt<bool> DylibsUsed;
54 extern cl::opt<bool> DylibId;
55 extern cl::opt<bool> ObjcMetaData;
56 extern cl::opt<std::string> DisSymName;
57 extern cl::opt<bool> NonVerbose;
58 extern cl::opt<bool> Relocations;
59 extern cl::opt<bool> SectionHeaders;
60 extern cl::opt<bool> SectionContents;
61 extern cl::opt<bool> SymbolTable;
62 extern cl::opt<bool> UnwindInfo;
63 extern cl::opt<bool> PrintImmHex;
64 extern cl::opt<DIDumpType> DwarfDumpType;
65
66 // Various helper functions.
67 void error(std::error_code ec);
68 bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
69 void ParseInputMachO(StringRef Filename);
70 void printCOFFUnwindInfo(const object::COFFObjectFile* o);
71 void printMachOUnwindInfo(const object::MachOObjectFile* o);
72 void printMachOExportsTrie(const object::MachOObjectFile* o);
73 void printMachORebaseTable(object::MachOObjectFile* o);
74 void printMachOBindTable(object::MachOObjectFile* o);
75 void printMachOLazyBindTable(object::MachOObjectFile* o);
76 void printMachOWeakBindTable(object::MachOObjectFile* o);
77 void printELFFileHeader(const object::ObjectFile *o);
78 void printCOFFFileHeader(const object::ObjectFile *o);
79 void printCOFFSymbolTable(const object::COFFImportFile *i);
80 void printCOFFSymbolTable(const object::COFFObjectFile *o);
81 void printMachOFileHeader(const object::ObjectFile *o);
82 void printMachOLoadCommands(const object::ObjectFile *o);
83 void printWasmFileHeader(const object::ObjectFile *o);
84 void printExportsTrie(const object::ObjectFile *o);
85 void printRebaseTable(object::ObjectFile *o);
86 void printBindTable(object::ObjectFile *o);
87 void printLazyBindTable(object::ObjectFile *o);
88 void printWeakBindTable(object::ObjectFile *o);
89 void printRawClangAST(const object::ObjectFile *o);
90 void PrintRelocations(const object::ObjectFile *o);
91 void PrintSectionHeaders(const object::ObjectFile *o);
92 void PrintSectionContents(const object::ObjectFile *o);
93 void PrintSymbolTable(const object::ObjectFile *o, StringRef ArchiveName,
94                       StringRef ArchitectureName = StringRef());
95 LLVM_ATTRIBUTE_NORETURN void error(Twine Message);
96 LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, Twine Message);
97 LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, std::error_code EC);
98 LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, llvm::Error E);
99 LLVM_ATTRIBUTE_NORETURN void report_error(StringRef FileName,
100                                           StringRef ArchiveName,
101                                           llvm::Error E,
102                                           StringRef ArchitectureName
103                                                     = StringRef());
104 LLVM_ATTRIBUTE_NORETURN void report_error(StringRef ArchiveName,
105                                           const object::Archive::Child &C,
106                                           llvm::Error E,
107                                           StringRef ArchitectureName
108                                                     = StringRef());
109
110 } // end namespace llvm
111
112 #endif