[ORC] Rename VSO to JITDylib.
VSO was a little close to VDSO (an acronym on Linux for Virtual Dynamic Shared
Object) for comfort. It also risks giving the impression that instances of this
class could be shared between ExecutionSessions, which they can not.
JITDylib seems moderately less confusing, while still hinting at how this
class is intended to be used, i.e. as a JIT-compiled stand-in for a dynamic
library (code that would have been a dynamic library if you had wanted to
compile it ahead of time).
llvm-svn: 340084
diff --git a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
index d42e7b0..b731814 100644
--- a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
@@ -202,7 +202,7 @@
std::move(ExtractedFunctionsModule));
}
- void discard(const VSO &V, SymbolStringPtr Name) override {
+ void discard(const JITDylib &V, SymbolStringPtr Name) override {
// All original symbols were materialized by the CODLayer and should be
// final. The function bodies provided by M should never be overridden.
llvm_unreachable("Discard should never be called on an "
@@ -221,7 +221,7 @@
BuildIndirectStubsManager(std::move(BuildIndirectStubsManager)),
GetAvailableContext(std::move(GetAvailableContext)) {}
-Error CompileOnDemandLayer2::add(VSO &V, VModuleKey K,
+Error CompileOnDemandLayer2::add(JITDylib &V, VModuleKey K,
std::unique_ptr<Module> M) {
return IRLayer::add(V, K, std::move(M));
}
@@ -245,7 +245,7 @@
// rest, and build the compile callbacks.
std::map<SymbolStringPtr, std::pair<JITTargetAddress, JITSymbolFlags>>
StubCallbacksAndLinkages;
- auto &TargetVSO = R.getTargetVSO();
+ auto &TargetJD = R.getTargetJITDylib();
for (auto &F : M->functions()) {
if (F.isDeclaration())
@@ -269,8 +269,8 @@
auto StubName = Mangle(StubUnmangledName);
auto BodyName = Mangle(F.getName());
if (auto CallbackAddr = CCMgr.getCompileCallback(
- [BodyName, &TargetVSO, &ES]() -> JITTargetAddress {
- if (auto Sym = lookup({&TargetVSO}, BodyName))
+ [BodyName, &TargetJD, &ES]() -> JITTargetAddress {
+ if (auto Sym = lookup({&TargetJD}, BodyName))
return Sym->getAddress();
else {
ES.reportError(Sym.takeError());
@@ -294,7 +294,7 @@
StubInits[*KV.first] = KV.second;
// Build the function-body-extracting materialization unit.
- if (auto Err = R.getTargetVSO().define(
+ if (auto Err = R.getTargetJITDylib().define(
llvm::make_unique<ExtractingIRMaterializationUnit>(ES, *this,
std::move(M)))) {
ES.reportError(std::move(Err));
@@ -304,7 +304,7 @@
// Build the stubs.
// FIXME: Remove function bodies materialization unit if stub creation fails.
- auto &StubsMgr = getStubsManager(TargetVSO);
+ auto &StubsMgr = getStubsManager(TargetJD);
if (auto Err = StubsMgr.createStubs(StubInits)) {
ES.reportError(std::move(Err));
R.failMaterialization();
@@ -325,7 +325,8 @@
BaseLayer.emit(std::move(R), std::move(K), std::move(GlobalsModule));
}
-IndirectStubsManager &CompileOnDemandLayer2::getStubsManager(const VSO &V) {
+IndirectStubsManager &
+CompileOnDemandLayer2::getStubsManager(const JITDylib &V) {
std::lock_guard<std::mutex> Lock(CODLayerMutex);
StubManagersMap::iterator I = StubsMgrs.find(&V);
if (I == StubsMgrs.end())