aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-09 01:04:06 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-09 01:04:06 +0000
commit8faf7df1447ca6ea4a3ff8f82789923d1839fb54 (patch)
tree8de048c3e79d57f0d52fba04c79614f63350c6b8 /lib/Object
parent7df9c57651574feccd53aec0aac469dea2b48bc6 (diff)
downloadexternal_llvm-8faf7df1447ca6ea4a3ff8f82789923d1839fb54.zip
external_llvm-8faf7df1447ca6ea4a3ff8f82789923d1839fb54.tar.gz
external_llvm-8faf7df1447ca6ea4a3ff8f82789923d1839fb54.tar.bz2
More uses for SymbolTableEntryBase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/MachOObjectFile.cpp44
1 files changed, 9 insertions, 35 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp
index ae30105..e1eec36 100644
--- a/lib/Object/MachOObjectFile.cpp
+++ b/lib/Object/MachOObjectFile.cpp
@@ -293,18 +293,9 @@ error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
error_code MachOObjectFile::getSymbolNMTypeChar(DataRefImpl DRI,
char &Result) const {
- uint8_t Type, Flags;
- if (is64Bit()) {
- const MachOFormat::SymbolTableEntry<true> *Entry =
- getSymbol64TableEntry(DRI);
- Type = Entry->Type;
- Flags = Entry->Flags;
- } else {
- const MachOFormat::SymbolTableEntry<false> *Entry =
- getSymbolTableEntry(DRI);
- Type = Entry->Type;
- Flags = Entry->Flags;
- }
+ const MachOFormat::SymbolTableEntryBase *Entry = getSymbolTableEntryBase(DRI);
+ uint8_t Type = Entry->Type;
+ uint16_t Flags = Entry->Flags;
char Char;
switch (Type & macho::STF_TypeMask) {
@@ -328,19 +319,9 @@ error_code MachOObjectFile::getSymbolNMTypeChar(DataRefImpl DRI,
error_code MachOObjectFile::getSymbolFlags(DataRefImpl DRI,
uint32_t &Result) const {
- uint16_t MachOFlags;
- uint8_t MachOType;
- if (is64Bit()) {
- const MachOFormat::SymbolTableEntry<true> *Entry =
- getSymbol64TableEntry(DRI);
- MachOFlags = Entry->Flags;
- MachOType = Entry->Type;
- } else {
- const MachOFormat::SymbolTableEntry<false> *Entry =
- getSymbolTableEntry(DRI);
- MachOFlags = Entry->Flags;
- MachOType = Entry->Type;
- }
+ const MachOFormat::SymbolTableEntryBase *Entry = getSymbolTableEntryBase(DRI);
+ uint8_t MachOType = Entry->Type;
+ uint16_t MachOFlags = Entry->Flags;
// TODO: Correctly set SF_ThreadLocal
Result = SymbolRef::SF_None;
@@ -368,16 +349,9 @@ error_code MachOObjectFile::getSymbolFlags(DataRefImpl DRI,
error_code MachOObjectFile::getSymbolSection(DataRefImpl Symb,
section_iterator &Res) const {
- uint8_t index;
- if (is64Bit()) {
- const MachOFormat::SymbolTableEntry<true> *Entry =
- getSymbol64TableEntry(Symb);
- index = Entry->SectionIndex;
- } else {
- const MachOFormat::SymbolTableEntry<false> *Entry =
- getSymbolTableEntry(Symb);
- index = Entry->SectionIndex;
- }
+ const MachOFormat::SymbolTableEntryBase *Entry =
+ getSymbolTableEntryBase(Symb);
+ uint8_t index = Entry->SectionIndex;
if (index == 0)
Res = end_sections();