[llvm] r241365 - Replace a few more MachO only uses of getSymbolAddress.
Rafael Espindola
rafael.espindola at gmail.com
Fri Jul 3 11:02:37 PDT 2015
Author: rafael
Date: Fri Jul 3 13:02:36 2015
New Revision: 241365
URL: http://llvm.org/viewvc/llvm-project?rev=241365&view=rev
Log:
Replace a few more MachO only uses of getSymbolAddress.
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp
llvm/trunk/tools/dsymutil/DebugMap.cpp
llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp?rev=241365&r1=241364&r2=241365&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp Fri Jul 3 13:02:36 2015
@@ -34,7 +34,7 @@ public:
if (std::error_code EC = SymNameOrErr.getError())
report_fatal_error(EC.message());
StringRef SymName = *SymNameOrErr;
- uint64_t SymAddr; SymI->getAddress(SymAddr);
+ uint64_t SymAddr = SymI->getValue();
any_relocation_info RE = Obj->getRelocation(Rel.getRawDataRefImpl());
bool isPCRel = Obj->getAnyRelocationPCRel(RE);
@@ -90,8 +90,7 @@ public:
const MCExpr *LHS = MCSymbolRefExpr::create(Sym, Ctx);
symbol_iterator RSymI = Rel.getSymbol();
- uint64_t RSymAddr;
- RSymI->getAddress(RSymAddr);
+ uint64_t RSymAddr = RSymI->getValue();
ErrorOr<StringRef> RSymName = RSymI->getName();
if (std::error_code EC = RSymName.getError())
report_fatal_error(EC.message());
Modified: llvm/trunk/tools/dsymutil/DebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/DebugMap.cpp?rev=241365&r1=241364&r2=241365&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/DebugMap.cpp (original)
+++ llvm/trunk/tools/dsymutil/DebugMap.cpp Fri Jul 3 13:02:36 2015
@@ -216,9 +216,7 @@ MappingTraits<dsymutil::DebugMapObject>:
// during the test, we can't hardcode the symbols addresses, so
// look them up here and rewrite them.
for (const auto &Sym : ErrOrObjectFile->symbols()) {
- uint64_t Address;
- if (Sym.getAddress(Address))
- continue;
+ uint64_t Address = Sym.getValue();
ErrorOr<StringRef> Name = Sym.getName();
if (!Name)
continue;
Modified: llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp?rev=241365&r1=241364&r2=241365&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp (original)
+++ llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp Fri Jul 3 13:02:36 2015
@@ -198,8 +198,8 @@ void MachODebugMapParser::loadCurrentObj
for (auto Sym : CurrentObjectHolder.Get().symbols()) {
- uint64_t Addr;
- if (Sym.getAddress(Addr) || Addr == UnknownAddress)
+ uint64_t Addr = Sym.getValue();
+ if (Addr == UnknownAddress)
continue;
ErrorOr<StringRef> Name = Sym.getName();
if (!Name)
@@ -228,14 +228,13 @@ void MachODebugMapParser::loadMainBinary
// Skip undefined and STAB entries.
if ((Type & SymbolRef::ST_Debug) || (Type & SymbolRef::ST_Unknown))
continue;
- uint64_t Addr;
+ uint64_t Addr = Sym.getValue();
// The only symbols of interest are the global variables. These
// are the only ones that need to be queried because the address
// of common data won't be described in the debug map. All other
// addresses should be fetched for the debug map.
- if (Sym.getAddress(Addr) || Addr == UnknownAddress ||
- !(Sym.getFlags() & SymbolRef::SF_Global) || Sym.getSection(Section) ||
- Section->isText())
+ if (Addr == UnknownAddress || !(Sym.getFlags() & SymbolRef::SF_Global) ||
+ Sym.getSection(Section) || Section->isText())
continue;
ErrorOr<StringRef> NameOrErr = Sym.getName();
if (!NameOrErr)
More information about the llvm-commits
mailing list