diff options
author | Eli Bendersky <eli.bendersky@intel.com> | 2012-05-01 06:58:59 +0000 |
---|---|---|
committer | Eli Bendersky <eli.bendersky@intel.com> | 2012-05-01 06:58:59 +0000 |
commit | fc079081b7ed8dc938c7b0b0bfbbeab010606884 (patch) | |
tree | fe331085b44d56406f295a1b5425c5688826b0cb /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | |
parent | bae0e9ea1d38a9584d7dd301a62200cf31456852 (diff) | |
download | bcm5719-llvm-fc079081b7ed8dc938c7b0b0bfbbeab010606884.tar.gz bcm5719-llvm-fc079081b7ed8dc938c7b0b0bfbbeab010606884.zip |
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
llvm-svn: 155898
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index 42dd24cce1e..f3ae7dcd98f 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/llvm/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; } |