Template the MachO types over endianness.
For now they are still only used as little endian.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179147 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp
index b0a1aca..d1e7d69 100644
--- a/tools/llvm-objdump/MachODump.cpp
+++ b/tools/llvm-objdump/MachODump.cpp
@@ -199,7 +199,7 @@
Out << "}\n";
}
-static void getSectionsAndSymbols(const MachOFormat::Header *Header,
+static void getSectionsAndSymbols(const MachOObjectFileBase::Header *Header,
MachOObjectFileBase *MachOObj,
std::vector<SectionRef> &Sections,
std::vector<SymbolRef> &Symbols,
@@ -218,12 +218,13 @@
}
for (unsigned i = 0; i != Header->NumLoadCommands; ++i) {
- const MachOFormat::LoadCommand *Command = MachOObj->getLoadCommandInfo(i);
+ const MachOObjectFileBase::LoadCommand *Command =
+ MachOObj->getLoadCommandInfo(i);
if (Command->Type == macho::LCT_FunctionStarts) {
// We found a function starts segment, parse the addresses for later
// consumption.
- const MachOFormat::LinkeditDataLoadCommand *LLC =
- reinterpret_cast<const MachOFormat::LinkeditDataLoadCommand*>(Command);
+ const MachOObjectFileBase::LinkeditDataLoadCommand *LLC =
+ reinterpret_cast<const MachOObjectFileBase::LinkeditDataLoadCommand*>(Command);
MachOObj->ReadULEB128s(LLC->DataOffset, FoundFns);
}
@@ -269,7 +270,7 @@
outs() << '\n' << Filename << ":\n\n";
- const MachOFormat::Header *Header = MachOOF->getHeader();
+ const MachOObjectFileBase::Header *Header = MachOOF->getHeader();
std::vector<SectionRef> Sections;
std::vector<SymbolRef> Symbols;