mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Avoid duplicate search by reusing the iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -308,18 +308,20 @@ public:
|
||||
void *getSymbolAddress(StringRef Name) {
|
||||
// FIXME: Just look up as a function for now. Overly simple of course.
|
||||
// Work in progress.
|
||||
if (GlobalSymbolTable.find(Name) == GlobalSymbolTable.end())
|
||||
SymbolTableMap::const_iterator pos = GlobalSymbolTable.find(Name);
|
||||
if (pos == GlobalSymbolTable.end())
|
||||
return 0;
|
||||
SymbolLoc Loc = GlobalSymbolTable.lookup(Name);
|
||||
SymbolLoc Loc = pos->second;
|
||||
return getSectionAddress(Loc.first) + Loc.second;
|
||||
}
|
||||
|
||||
uint64_t getSymbolLoadAddress(StringRef Name) {
|
||||
// FIXME: Just look up as a function for now. Overly simple of course.
|
||||
// Work in progress.
|
||||
if (GlobalSymbolTable.find(Name) == GlobalSymbolTable.end())
|
||||
SymbolTableMap::const_iterator pos = GlobalSymbolTable.find(Name);
|
||||
if (pos == GlobalSymbolTable.end())
|
||||
return 0;
|
||||
SymbolLoc Loc = GlobalSymbolTable.lookup(Name);
|
||||
SymbolLoc Loc = pos->second;
|
||||
return getSectionLoadAddress(Loc.first) + Loc.second;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user