7303c3a041807adbdcd4d9d086c3f8759f3abda1
[oota-llvm.git] / 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/ADT/StringRef.h"
13 #include "llvm/DebugInfo/DIContext.h"
14 #include "llvm/Support/CommandLine.h"
15 #include "llvm/Support/DataTypes.h"
16
17 namespace llvm {
18 namespace object {
19   class COFFObjectFile;
20   class MachOObjectFile;
21   class ObjectFile;
22   class RelocationRef;
23 }
24
25 extern cl::opt<std::string> TripleName;
26 extern cl::opt<std::string> ArchName;
27 extern cl::opt<std::string> MCPU;
28 extern cl::list<std::string> MAttrs;
29 extern cl::list<std::string> FilterSections;
30 extern cl::opt<bool> Disassemble;
31 extern cl::opt<bool> DisassembleAll;
32 extern cl::opt<bool> NoShowRawInsn;
33 extern cl::opt<bool> PrivateHeaders;
34 extern cl::opt<bool> ExportsTrie;
35 extern cl::opt<bool> Rebase;
36 extern cl::opt<bool> Bind;
37 extern cl::opt<bool> LazyBind;
38 extern cl::opt<bool> WeakBind;
39 extern cl::opt<bool> RawClangAST;
40 extern cl::opt<bool> UniversalHeaders;
41 extern cl::opt<bool> ArchiveHeaders;
42 extern cl::opt<bool> IndirectSymbols;
43 extern cl::opt<bool> DataInCode;
44 extern cl::opt<bool> LinkOptHints;
45 extern cl::opt<bool> InfoPlist;
46 extern cl::opt<bool> DylibsUsed;
47 extern cl::opt<bool> DylibId;
48 extern cl::opt<bool> ObjcMetaData;
49 extern cl::opt<std::string> DisSymName;
50 extern cl::opt<bool> NonVerbose;
51 extern cl::opt<bool> Relocations;
52 extern cl::opt<bool> SectionHeaders;
53 extern cl::opt<bool> SectionContents;
54 extern cl::opt<bool> SymbolTable;
55 extern cl::opt<bool> UnwindInfo;
56 extern cl::opt<bool> PrintImmHex;
57 extern cl::opt<DIDumpType> DwarfDumpType;
58
59 // Various helper functions.
60 void error(std::error_code ec);
61 bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
62 void ParseInputMachO(StringRef Filename);
63 void printCOFFUnwindInfo(const object::COFFObjectFile* o);
64 void printMachOUnwindInfo(const object::MachOObjectFile* o);
65 void printMachOExportsTrie(const object::MachOObjectFile* o);
66 void printMachORebaseTable(const object::MachOObjectFile* o);
67 void printMachOBindTable(const object::MachOObjectFile* o);
68 void printMachOLazyBindTable(const object::MachOObjectFile* o);
69 void printMachOWeakBindTable(const object::MachOObjectFile* o);
70 void printELFFileHeader(const object::ObjectFile *o);
71 void printCOFFFileHeader(const object::ObjectFile *o);
72 void printMachOFileHeader(const object::ObjectFile *o);
73 void printExportsTrie(const object::ObjectFile *o);
74 void printRebaseTable(const object::ObjectFile *o);
75 void printBindTable(const object::ObjectFile *o);
76 void printLazyBindTable(const object::ObjectFile *o);
77 void printWeakBindTable(const object::ObjectFile *o);
78 void printRawClangAST(const object::ObjectFile *o);
79 void PrintRelocations(const object::ObjectFile *o);
80 void PrintSectionHeaders(const object::ObjectFile *o);
81 void PrintSectionContents(const object::ObjectFile *o);
82 void PrintSymbolTable(const object::ObjectFile *o);
83 void report_error(StringRef File, std::error_code EC);
84
85 } // end namespace llvm
86
87 #endif