From b08c6df6787971502bd51e30b0f1038c1ea0dc2c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 10 Apr 2013 15:33:44 +0000 Subject: Template MachOObjectFile over endianness too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179179 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-readobj/MachODumper.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tools/llvm-readobj') diff --git a/tools/llvm-readobj/MachODumper.cpp b/tools/llvm-readobj/MachODumper.cpp index 3dad4d6e54..2073ddf463 100644 --- a/tools/llvm-readobj/MachODumper.cpp +++ b/tools/llvm-readobj/MachODumper.cpp @@ -160,8 +160,8 @@ namespace { static void getSection(const MachOObjectFileBase *Obj, DataRefImpl DRI, MachOSection &Section) { - if (const MachOObjectFile *O = dyn_cast >(Obj)) { - const MachOObjectFile::Section *Sect = O->getSection(DRI); + if (const MachOObjectFile64Le *O = dyn_cast(Obj)) { + const MachOObjectFile64Le::Section *Sect = O->getSection(DRI); Section.Address = Sect->Address; Section.Size = Sect->Size; @@ -173,8 +173,8 @@ static void getSection(const MachOObjectFileBase *Obj, Section.Reserved1 = Sect->Reserved1; Section.Reserved2 = Sect->Reserved2; } else { - const MachOObjectFile *O2 = cast >(Obj); - const MachOObjectFile::Section *Sect = O2->getSection(DRI); + const MachOObjectFile32Le *O2 = cast(Obj); + const MachOObjectFile32Le::Section *Sect = O2->getSection(DRI); Section.Address = Sect->Address; Section.Size = Sect->Size; @@ -191,8 +191,8 @@ static void getSection(const MachOObjectFileBase *Obj, static void getSymbol(const MachOObjectFileBase *Obj, DataRefImpl DRI, MachOSymbol &Symbol) { - if (const MachOObjectFile *O = dyn_cast >(Obj)) { - const MachOObjectFile::SymbolTableEntry *Entry = + if (const MachOObjectFile64Le *O = dyn_cast(Obj)) { + const MachOObjectFile64Le::SymbolTableEntry *Entry = O->getSymbolTableEntry(DRI); Symbol.StringIndex = Entry->StringIndex; Symbol.Type = Entry->Type; @@ -200,8 +200,8 @@ static void getSymbol(const MachOObjectFileBase *Obj, Symbol.Flags = Entry->Flags; Symbol.Value = Entry->Value; } else { - const MachOObjectFile *O2 = cast >(Obj); - const MachOObjectFile::SymbolTableEntry *Entry = + const MachOObjectFile32Le *O2 = cast(Obj); + const MachOObjectFile32Le::SymbolTableEntry *Entry = O2->getSymbolTableEntry(DRI); Symbol.StringIndex = Entry->StringIndex; Symbol.Type = Entry->Type; -- cgit v1.2.3