Slightly refactor things for llvm-objdump and the -macho option so it can be used...
[oota-llvm.git] / tools / llvm-objdump / llvm-objdump.h
1 //===-- llvm-objdump.h ----------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
11 #define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
12
13 #include "llvm/ADT/StringRef.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::opt<bool> Disassemble;
30 extern cl::opt<bool> NoShowRawInsn;
31 extern cl::opt<bool> PrivateHeaders;
32 extern cl::opt<bool> ExportsTrie;
33 extern cl::opt<bool> Rebase;
34 extern cl::opt<bool> Bind;
35 extern cl::opt<bool> LazyBind;
36 extern cl::opt<bool> WeakBind;
37
38 // Various helper functions.
39 bool error(std::error_code ec);
40 bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
41 void DumpBytes(StringRef bytes);
42 void ParseInputMachO(StringRef Filename);
43 void printCOFFUnwindInfo(const object::COFFObjectFile* o);
44 void printMachOUnwindInfo(const object::MachOObjectFile* o);
45 void printMachOExportsTrie(const object::MachOObjectFile* o);
46 void printMachORebaseTable(const object::MachOObjectFile* o);
47 void printMachOBindTable(const object::MachOObjectFile* o);
48 void printMachOLazyBindTable(const object::MachOObjectFile* o);
49 void printMachOWeakBindTable(const object::MachOObjectFile* o);
50 void printELFFileHeader(const object::ObjectFile *o);
51 void printCOFFFileHeader(const object::ObjectFile *o);
52 void printMachOFileHeader(const object::ObjectFile *o);
53 void printExportsTrie(const object::ObjectFile *o);
54 void printRebaseTable(const object::ObjectFile *o);
55 void printBindTable(const object::ObjectFile *o);
56 void printLazyBindTable(const object::ObjectFile *o);
57 void printWeakBindTable(const object::ObjectFile *o);
58
59 } // end namespace llvm
60
61 #endif