summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
diff options
context:
space:
mode:
authorEli Bendersky <eli.bendersky@intel.com>2012-05-01 06:58:59 +0000
committerEli Bendersky <eli.bendersky@intel.com>2012-05-01 06:58:59 +0000
commitd98c9e918c9750d965c1efe9efcc9e13feacbe13 (patch)
treed85e0b1338e2838386364bc04162ac44393267b2 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
parente499cdf10c157d447393708b3a28497e42b1b555 (diff)
downloadllvm-d98c9e918c9750d965c1efe9efcc9e13feacbe13.tar.gz
llvm-d98c9e918c9750d965c1efe9efcc9e13feacbe13.tar.bz2
llvm-d98c9e918c9750d965c1efe9efcc9e13feacbe13.tar.xz
RuntimeDyld code cleanup:
- There's no point having a different type for the local and global symbol tables. - Renamed SymbolTable to GlobalSymbolTable to clarify the intention - Improved const correctness where relevant git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index 42dd24cce1..f3ae7dcd98 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -129,11 +129,11 @@ protected:
// references it.
typedef std::map<SectionRef, unsigned> ObjSectionToIDMap;
- // Master symbol table. As modules are loaded and symbols are
- // resolved, their addresses are stored here as a SectionID/Offset pair.
+ // A global symbol table for symbols from all loaded modules. Maps the
+ // symbol name to a (SectionID, offset in section) pair.
typedef std::pair<unsigned, uintptr_t> SymbolLoc;
- StringMap<SymbolLoc> SymbolTable;
- typedef DenseMap<const char*, SymbolLoc> LocalSymbolMap;
+ typedef StringMap<SymbolLoc> SymbolTableMap;
+ SymbolTableMap GlobalSymbolTable;
// Keep a map of common symbols to their sizes
typedef std::map<SymbolRef, unsigned> CommonSymbolMap;
@@ -184,7 +184,7 @@ protected:
unsigned emitCommonSymbols(ObjectImage &Obj,
const CommonSymbolMap &Map,
uint64_t TotalSize,
- LocalSymbolMap &Symbols);
+ SymbolTableMap &Symbols);
/// \brief Emits section data from the object file to the MemoryManager.
/// \param IsCode if it's true then allocateCodeSection() will be
@@ -234,7 +234,7 @@ protected:
virtual void processRelocationRef(const ObjRelocationInfo &Rel,
ObjectImage &Obj,
ObjSectionToIDMap &ObjSectionToID,
- LocalSymbolMap &Symbols,
+ const SymbolTableMap &Symbols,
StubMap &Stubs) = 0;
/// \brief Resolve relocations to external symbols.
@@ -256,9 +256,9 @@ public:
void *getSymbolAddress(StringRef Name) {
// FIXME: Just look up as a function for now. Overly simple of course.
// Work in progress.
- if (SymbolTable.find(Name) == SymbolTable.end())
+ if (GlobalSymbolTable.find(Name) == GlobalSymbolTable.end())
return 0;
- SymbolLoc Loc = SymbolTable.lookup(Name);
+ SymbolLoc Loc = GlobalSymbolTable.lookup(Name);
return getSectionAddress(Loc.first) + Loc.second;
}