summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2015-02-09 01:20:51 +0000
committerLang Hames <lhames@gmail.com>2015-02-09 01:20:51 +0000
commit114b4f324b24760d6c3e12e60b0ea75956e8168e (patch)
treefad5aaa9c03f553aaee89906691c3a151213d9a8 /llvm/lib/ExecutionEngine/Orc
parenta021ee62caf49739aa46164326d07909dbc8a989 (diff)
downloadbcm5719-llvm-114b4f324b24760d6c3e12e60b0ea75956e8168e.tar.gz
bcm5719-llvm-114b4f324b24760d6c3e12e60b0ea75956e8168e.zip
[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.
This patch refactors a key piece of the Orc APIs: It removes the *::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn respectively, which return instances of the new JITSymbol type. Unlike the old methods, calling findSymbol or findSymbolIn does not cause the symbol to be immediately materialized when found. Instead, the symbol will be materialized if/when the getAddress method is called on the returned JITSymbol. This allows us to query for the existence of symbols without actually materializing them. In the future I expect more information to be attached to the JITSymbol class, for example whether the returned symbol is a weak or strong definition. This will allow us to properly handle weak symbols and multiple definitions. llvm-svn: 228557
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
index ddbc73251c7..f09d13e87bd 100644
--- a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
+++ b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
@@ -213,7 +213,7 @@ public:
private:
uint64_t getSymbolAddressWithoutMangling(StringRef Name) {
- if (uint64_t Addr = LazyEmitLayer.getSymbolAddress(Name, false))
+ if (uint64_t Addr = LazyEmitLayer.findSymbol(Name, false).getAddress())
return Addr;
if (uint64_t Addr = MM->getSymbolAddress(Name))
return Addr;
@@ -241,7 +241,7 @@ private:
static_cast<object::ObjectFile *>(ChildBin.release())));
ObjectLayer.addObjectSet(
std::move(ObjSet), llvm::make_unique<ForwardingRTDyldMM>(*this));
- if (uint64_t Addr = ObjectLayer.getSymbolAddress(Name, true))
+ if (uint64_t Addr = ObjectLayer.findSymbol(Name, true).getAddress())
return Addr;
}
}
OpenPOWER on IntegriCloud