Use getValue instead of getAddress in a few MachO only cases.

In MachO the value of the symbol is always the address, so we can use the
simpler function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-07-03 17:44:18 +00:00
parent a89ad42b36
commit e235dc4936
2 changed files with 11 additions and 28 deletions

View File

@ -392,9 +392,7 @@ uint32_t MachOObjectFile::getSymbolAlignment(DataRefImpl DRI) const {
}
uint64_t MachOObjectFile::getCommonSymbolSizeImpl(DataRefImpl DRI) const {
uint64_t Value;
getSymbolAddress(DRI, Value);
return Value;
return getSymbolValue(DRI);
}
SymbolRef::Type MachOObjectFile::getSymbolType(DataRefImpl Symb) const {
@ -434,8 +432,7 @@ uint32_t MachOObjectFile::getSymbolFlags(DataRefImpl DRI) const {
if (MachOType & MachO::N_EXT) {
Result |= SymbolRef::SF_Global;
if ((MachOType & MachO::N_TYPE) == MachO::N_UNDF) {
uint64_t Value;
getSymbolAddress(DRI, Value);
uint64_t Value = getSymbolValue(DRI);
if (Value && Value != UnknownAddress)
Result |= SymbolRef::SF_Common;
}