mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-11 00:39:36 +00:00
Replace a few more MachO only uses of getSymbolAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241365 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e235dc4936
commit
115b2eb8bf
@ -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());
|
||||
|
@ -216,9 +216,7 @@ MappingTraits<dsymutil::DebugMapObject>::YamlDMO::denormalize(IO &IO) {
|
||||
// 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;
|
||||
|
@ -198,8 +198,8 @@ void MachODebugMapParser::loadCurrentObjectFileSymbols() {
|
||||
|
||||
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::loadMainBinarySymbols() {
|
||||
// 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user