summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-10 03:48:25 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-10 03:48:25 +0000
commiteaae687d3e8211c0adeaedb7b6730529f7bc5e4f (patch)
treee066f38083e412a4efed62d0492854a8de85fea7 /llvm/lib/Object/MachOObjectFile.cpp
parente9c2407c98ef01a62c5f4ce7fe51a426400c54d9 (diff)
downloadbcm5719-llvm-eaae687d3e8211c0adeaedb7b6730529f7bc5e4f.tar.gz
bcm5719-llvm-eaae687d3e8211c0adeaedb7b6730529f7bc5e4f.zip
Template the MachO types over endianness.
For now they are still only used as little endian. llvm-svn: 179147
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 20b66d94e8c..33c63b0f896 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -127,8 +127,8 @@ MachOObjectFileBase::getSymbolTableEntryBase(DataRefImpl DRI,
unsigned Index = DRI.d.b;
unsigned SymbolTableEntrySize = is64Bit() ?
- sizeof(MachOFormat::SymbolTableEntry<true>) :
- sizeof(MachOFormat::SymbolTableEntry<false>);
+ sizeof(MachOObjectFile<true>::SymbolTableEntry) :
+ sizeof(MachOObjectFile<false>::SymbolTableEntry);
uint64_t Offset = SymbolTableOffset + Index * SymbolTableEntrySize;
StringRef Data = getData(Offset, SymbolTableEntrySize);
@@ -314,10 +314,10 @@ MachOObjectFileBase::getSectionBase(DataRefImpl DRI) const {
bool Is64 = is64Bit();
unsigned SegmentLoadSize =
- Is64 ? sizeof(MachOFormat::SegmentLoadCommand<true>) :
- sizeof(MachOFormat::SegmentLoadCommand<false>);
- unsigned SectionSize = Is64 ? sizeof(MachOFormat::Section<true>) :
- sizeof(MachOFormat::Section<false>);
+ Is64 ? sizeof(MachOObjectFile<true>::SegmentLoadCommand) :
+ sizeof(MachOObjectFile<false>::SegmentLoadCommand);
+ unsigned SectionSize = Is64 ? sizeof(MachOObjectFile<true>::Section) :
+ sizeof(MachOObjectFile<false>::Section);
uintptr_t SectionAddr = CommandAddr + SegmentLoadSize + DRI.d.b * SectionSize;
return reinterpret_cast<const SectionBase*>(SectionAddr);
OpenPOWER on IntegriCloud