summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-12-09 16:13:59 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-12-09 16:13:59 +0000
commit527e846ef7d15ee17459ab7b9e7454504f9b1b96 (patch)
treec4eb5e3ea6926c61504272746692c5fb03dc42f9 /llvm/lib/Object/IRObjectFile.cpp
parenta94a68a8d2b9f9c64b2d75fa5a9d6b178c03f4b8 (diff)
downloadbcm5719-llvm-527e846ef7d15ee17459ab7b9e7454504f9b1b96.tar.gz
bcm5719-llvm-527e846ef7d15ee17459ab7b9e7454504f9b1b96.zip
Don't lookup an object symbol name in the module.
Instead, walk the obj symbol list in parallel to find the GV. This shouldn't change anything on ELF where global symbols are not mangled, but it is a step toward supporting other object formats. Gold itself is ELF only, but bfd ld supports COFF and the logic in the gold plugin could be reused on lld. llvm-svn: 223780
Diffstat (limited to 'llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r--llvm/lib/Object/IRObjectFile.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index 7256a2fc007..84b6c95f2c7 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -116,7 +116,7 @@ IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> Mod)
IRObjectFile::~IRObjectFile() {
}
-static const GlobalValue *getGV(DataRefImpl &Symb) {
+static GlobalValue *getGV(DataRefImpl &Symb) {
if ((Symb.p & 3) == 3)
return nullptr;
@@ -235,10 +235,7 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const {
return Res;
}
-const GlobalValue *IRObjectFile::getSymbolGV(DataRefImpl Symb) const {
- const GlobalValue *GV = getGV(Symb);
- return GV;
-}
+GlobalValue *IRObjectFile::getSymbolGV(DataRefImpl Symb) { return getGV(Symb); }
basic_symbol_iterator IRObjectFile::symbol_begin_impl() const {
Module::const_iterator I = M->begin();
OpenPOWER on IntegriCloud