summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-08-17 21:18:18 +0000
committerLang Hames <lhames@gmail.com>2018-08-17 21:18:18 +0000
commitd5f56c5979d697f1c9eabf0bdfd882baac55f402 (patch)
tree429704c49ac5d2242df1cf08cae2ce572975add7 /llvm/unittests/ExecutionEngine/Orc
parent469f076356e864b438a96a17b4c265014277e982 (diff)
downloadbcm5719-llvm-d5f56c5979d697f1c9eabf0bdfd882baac55f402.tar.gz
bcm5719-llvm-d5f56c5979d697f1c9eabf0bdfd882baac55f402.zip
[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
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp184
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/LegacyAPIInteropTest.cpp16
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h4
3 files changed, 103 insertions, 101 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
index 68c081dd520..a1c93740f78 100644
--- a/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
@@ -26,7 +26,8 @@ class SimpleMaterializationUnit : public MaterializationUnit {
public:
using MaterializeFunction =
std::function<void(MaterializationResponsibility)>;
- using DiscardFunction = std::function<void(const VSO &, SymbolStringPtr)>;
+ using DiscardFunction =
+ std::function<void(const JITDylib &, SymbolStringPtr)>;
using DestructorFunction = std::function<void()>;
SimpleMaterializationUnit(
@@ -46,9 +47,9 @@ public:
Materialize(std::move(R));
}
- void discard(const VSO &V, SymbolStringPtr Name) override {
+ void discard(const JITDylib &JD, SymbolStringPtr Name) override {
if (Discard)
- Discard(V, std::move(Name));
+ Discard(JD, std::move(Name));
else
llvm_unreachable("Discard not supported");
}
@@ -79,13 +80,13 @@ TEST_F(CoreAPIsStandardTest, BasicSuccessfulLookup) {
std::shared_ptr<MaterializationResponsibility> FooMR;
- cantFail(V.define(llvm::make_unique<SimpleMaterializationUnit>(
+ cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}}),
[&](MaterializationResponsibility R) {
FooMR = std::make_shared<MaterializationResponsibility>(std::move(R));
})));
- ES.lookup({&V}, {Foo}, OnResolution, OnReady, NoDependenciesToRegister);
+ ES.lookup({&JD}, {Foo}, OnResolution, OnReady, NoDependenciesToRegister);
EXPECT_FALSE(OnResolutionRun) << "Should not have been resolved yet";
EXPECT_FALSE(OnReadyRun) << "Should not have been marked ready yet";
@@ -138,16 +139,16 @@ TEST_F(CoreAPIsStandardTest, EmptyLookup) {
OnReadyRun = true;
};
- ES.lookup({&V}, {}, OnResolution, OnReady, NoDependenciesToRegister);
+ ES.lookup({&JD}, {}, OnResolution, OnReady, NoDependenciesToRegister);
EXPECT_TRUE(OnResolvedRun) << "OnResolved was not run for empty query";
EXPECT_TRUE(OnReadyRun) << "OnReady was not run for empty query";
}
-TEST_F(CoreAPIsStandardTest, ChainedVSOLookup) {
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
+TEST_F(CoreAPIsStandardTest, ChainedJITDylibLookup) {
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
- auto &V2 = ES.createVSO("V2");
+ auto &JD2 = ES.createJITDylib("JD2");
bool OnResolvedRun = false;
bool OnReadyRun = false;
@@ -163,7 +164,7 @@ TEST_F(CoreAPIsStandardTest, ChainedVSOLookup) {
OnReadyRun = true;
});
- V2.legacyLookup(Q, V.legacyLookup(Q, {Foo}));
+ JD2.legacyLookup(Q, JD.legacyLookup(Q, {Foo}));
EXPECT_TRUE(OnResolvedRun) << "OnResolved was not run for empty query";
EXPECT_TRUE(OnReadyRun) << "OnReady was not run for empty query";
@@ -182,12 +183,12 @@ TEST_F(CoreAPIsStandardTest, LookupFlagsTest) {
llvm_unreachable("Symbol materialized on flags lookup");
});
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
- cantFail(V.define(std::move(MU)));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
+ cantFail(JD.define(std::move(MU)));
SymbolNameSet Names({Foo, Bar, Baz});
- auto SymbolFlags = V.lookupFlags(Names);
+ auto SymbolFlags = JD.lookupFlags(Names);
EXPECT_EQ(SymbolFlags.size(), 2U)
<< "Returned symbol flags contains unexpected results";
@@ -201,12 +202,12 @@ TEST_F(CoreAPIsStandardTest, LookupFlagsTest) {
}
TEST_F(CoreAPIsStandardTest, TestBasicAliases) {
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}, {Bar, BarSym}})));
- cantFail(V.define(symbolAliases({{Baz, {Foo, JITSymbolFlags::Exported}},
- {Qux, {Bar, JITSymbolFlags::Weak}}})));
- cantFail(V.define(absoluteSymbols({{Qux, QuxSym}})));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}, {Bar, BarSym}})));
+ cantFail(JD.define(symbolAliases({{Baz, {Foo, JITSymbolFlags::Exported}},
+ {Qux, {Bar, JITSymbolFlags::Weak}}})));
+ cantFail(JD.define(absoluteSymbols({{Qux, QuxSym}})));
- auto Result = lookup({&V}, {Baz, Qux});
+ auto Result = lookup({&JD}, {Baz, Qux});
EXPECT_TRUE(!!Result) << "Unexpected lookup failure";
EXPECT_EQ(Result->count(Baz), 1U) << "No result for \"baz\"";
EXPECT_EQ(Result->count(Qux), 1U) << "No result for \"qux\"";
@@ -217,11 +218,11 @@ TEST_F(CoreAPIsStandardTest, TestBasicAliases) {
}
TEST_F(CoreAPIsStandardTest, TestChainedAliases) {
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
- cantFail(V.define(symbolAliases(
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
+ cantFail(JD.define(symbolAliases(
{{Baz, {Bar, BazSym.getFlags()}}, {Bar, {Foo, BarSym.getFlags()}}})));
- auto Result = lookup({&V}, {Bar, Baz});
+ auto Result = lookup({&JD}, {Bar, Baz});
EXPECT_TRUE(!!Result) << "Unexpected lookup failure";
EXPECT_EQ(Result->count(Bar), 1U) << "No result for \"bar\"";
EXPECT_EQ(Result->count(Baz), 1U) << "No result for \"baz\"";
@@ -233,14 +234,14 @@ TEST_F(CoreAPIsStandardTest, TestChainedAliases) {
TEST_F(CoreAPIsStandardTest, TestBasicReExports) {
// Test that the basic use case of re-exporting a single symbol from another
- // VSO works.
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
+ // JITDylib works.
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
- auto &V2 = ES.createVSO("V2");
+ auto &JD2 = ES.createJITDylib("JD2");
- cantFail(V2.define(reexports(V, {{Bar, {Foo, BarSym.getFlags()}}})));
+ cantFail(JD2.define(reexports(JD, {{Bar, {Foo, BarSym.getFlags()}}})));
- auto Result = cantFail(lookup({&V2}, Bar));
+ auto Result = cantFail(lookup({&JD2}, Bar));
EXPECT_EQ(Result.getAddress(), FooSym.getAddress())
<< "Re-export Bar for symbol Foo should match FooSym's address";
}
@@ -248,7 +249,7 @@ TEST_F(CoreAPIsStandardTest, TestBasicReExports) {
TEST_F(CoreAPIsStandardTest, TestThatReExportsDontUnnecessarilyMaterialize) {
// Test that re-exports do not materialize symbols that have not been queried
// for.
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
bool BarMaterialized = false;
auto BarMU = llvm::make_unique<SimpleMaterializationUnit>(
@@ -259,14 +260,14 @@ TEST_F(CoreAPIsStandardTest, TestThatReExportsDontUnnecessarilyMaterialize) {
R.finalize();
});
- cantFail(V.define(BarMU));
+ cantFail(JD.define(BarMU));
- auto &V2 = ES.createVSO("V2");
+ auto &JD2 = ES.createJITDylib("JD2");
- cantFail(V2.define(reexports(
- V, {{Baz, {Foo, BazSym.getFlags()}}, {Qux, {Bar, QuxSym.getFlags()}}})));
+ cantFail(JD2.define(reexports(
+ JD, {{Baz, {Foo, BazSym.getFlags()}}, {Qux, {Bar, QuxSym.getFlags()}}})));
- auto Result = cantFail(lookup({&V2}, Baz));
+ auto Result = cantFail(lookup({&JD2}, Baz));
EXPECT_EQ(Result.getAddress(), FooSym.getAddress())
<< "Re-export Baz for symbol Foo should match FooSym's address";
@@ -277,19 +278,19 @@ TEST_F(CoreAPIsStandardTest, TestReexportsFallbackGenerator) {
// Test that a re-exports fallback generator can dynamically generate
// reexports.
- auto &V2 = ES.createVSO("V2");
- cantFail(V2.define(absoluteSymbols({{Foo, FooSym}, {Bar, BarSym}})));
+ auto &JD2 = ES.createJITDylib("JD2");
+ cantFail(JD2.define(absoluteSymbols({{Foo, FooSym}, {Bar, BarSym}})));
auto Filter = [this](SymbolStringPtr Name) { return Name != Bar; };
- V.setFallbackDefinitionGenerator(
- ReexportsFallbackDefinitionGenerator(V2, Filter));
+ JD.setFallbackDefinitionGenerator(
+ ReexportsFallbackDefinitionGenerator(JD2, Filter));
- auto Flags = V.lookupFlags({Foo, Bar, Baz});
+ auto Flags = JD.lookupFlags({Foo, Bar, Baz});
EXPECT_EQ(Flags.size(), 1U) << "Unexpected number of results";
EXPECT_EQ(Flags[Foo], FooSym.getFlags()) << "Unexpected flags for Foo";
- auto Result = cantFail(lookup({&V}, Foo));
+ auto Result = cantFail(lookup({&JD}, Foo));
EXPECT_EQ(Result.getAddress(), FooSym.getAddress())
<< "Incorrect reexported symbol address";
@@ -301,7 +302,7 @@ TEST_F(CoreAPIsStandardTest, TestTrivialCircularDependency) {
SymbolFlagsMap({{Foo, FooSym.getFlags()}}),
[&](MaterializationResponsibility R) { FooR.emplace(std::move(R)); });
- cantFail(V.define(FooMU));
+ cantFail(JD.define(FooMU));
bool FooReady = false;
auto OnResolution = [](Expected<SymbolMap> R) { cantFail(std::move(R)); };
@@ -310,7 +311,7 @@ TEST_F(CoreAPIsStandardTest, TestTrivialCircularDependency) {
FooReady = true;
};
- ES.lookup({&V}, {Foo}, std::move(OnResolution), std::move(OnReady),
+ ES.lookup({&JD}, {Foo}, std::move(OnResolution), std::move(OnReady),
NoDependenciesToRegister);
FooR->resolve({{Foo, FooSym}});
@@ -320,9 +321,9 @@ TEST_F(CoreAPIsStandardTest, TestTrivialCircularDependency) {
<< "Self-dependency prevented symbol from being marked ready";
}
-TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneVSO) {
- // Test that a circular symbol dependency between three symbols in a VSO does
- // not prevent any symbol from becoming 'ready' once all symbols are
+TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneJITDylib) {
+ // Test that a circular symbol dependency between three symbols in a JITDylib
+ // does not prevent any symbol from becoming 'ready' once all symbols are
// finalized.
// Create three MaterializationResponsibility objects: one for each of Foo,
@@ -347,9 +348,9 @@ TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneVSO) {
[&](MaterializationResponsibility R) { BazR.emplace(std::move(R)); });
// Define the symbols.
- cantFail(V.define(FooMU));
- cantFail(V.define(BarMU));
- cantFail(V.define(BazMU));
+ cantFail(JD.define(FooMU));
+ cantFail(JD.define(BarMU));
+ cantFail(JD.define(BazMU));
// Query each of the symbols to trigger materialization.
bool FooResolved = false;
@@ -367,7 +368,7 @@ TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneVSO) {
// Issue a lookup for Foo. Use NoDependenciesToRegister: We're going to add
// the dependencies manually below.
- ES.lookup({&V}, {Foo}, std::move(OnFooResolution), std::move(OnFooReady),
+ ES.lookup({&JD}, {Foo}, std::move(OnFooResolution), std::move(OnFooReady),
NoDependenciesToRegister);
bool BarResolved = false;
@@ -382,7 +383,7 @@ TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneVSO) {
BarReady = true;
};
- ES.lookup({&V}, {Bar}, std::move(OnBarResolution), std::move(OnBarReady),
+ ES.lookup({&JD}, {Bar}, std::move(OnBarResolution), std::move(OnBarReady),
NoDependenciesToRegister);
bool BazResolved = false;
@@ -398,19 +399,19 @@ TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneVSO) {
BazReady = true;
};
- ES.lookup({&V}, {Baz}, std::move(OnBazResolution), std::move(OnBazReady),
+ ES.lookup({&JD}, {Baz}, std::move(OnBazResolution), std::move(OnBazReady),
NoDependenciesToRegister);
// Add a circular dependency: Foo -> Bar, Bar -> Baz, Baz -> Foo.
- FooR->addDependenciesForAll({{&V, SymbolNameSet({Bar})}});
- BarR->addDependenciesForAll({{&V, SymbolNameSet({Baz})}});
- BazR->addDependenciesForAll({{&V, SymbolNameSet({Foo})}});
+ FooR->addDependenciesForAll({{&JD, SymbolNameSet({Bar})}});
+ BarR->addDependenciesForAll({{&JD, SymbolNameSet({Baz})}});
+ BazR->addDependenciesForAll({{&JD, SymbolNameSet({Foo})}});
// Add self-dependencies for good measure. This tests that the implementation
// of addDependencies filters these out.
- FooR->addDependenciesForAll({{&V, SymbolNameSet({Foo})}});
- BarR->addDependenciesForAll({{&V, SymbolNameSet({Bar})}});
- BazR->addDependenciesForAll({{&V, SymbolNameSet({Baz})}});
+ FooR->addDependenciesForAll({{&JD, SymbolNameSet({Foo})}});
+ BarR->addDependenciesForAll({{&JD, SymbolNameSet({Bar})}});
+ BazR->addDependenciesForAll({{&JD, SymbolNameSet({Baz})}});
// Check that nothing has been resolved yet.
EXPECT_FALSE(FooResolved) << "\"Foo\" should not be resolved yet";
@@ -460,20 +461,20 @@ TEST_F(CoreAPIsStandardTest, DropMaterializerWhenEmpty) {
[](MaterializationResponsibility R) {
llvm_unreachable("Unexpected call to materialize");
},
- [&](const VSO &V, SymbolStringPtr Name) {
+ [&](const JITDylib &JD, SymbolStringPtr Name) {
EXPECT_TRUE(Name == Foo || Name == Bar)
<< "Discard of unexpected symbol?";
},
[&]() { DestructorRun = true; });
- cantFail(V.define(MU));
+ cantFail(JD.define(MU));
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
EXPECT_FALSE(DestructorRun)
<< "MaterializationUnit should not have been destroyed yet";
- cantFail(V.define(absoluteSymbols({{Bar, BarSym}})));
+ cantFail(JD.define(absoluteSymbols({{Bar, BarSym}})));
EXPECT_TRUE(DestructorRun)
<< "MaterializationUnit should have been destroyed";
@@ -494,13 +495,13 @@ TEST_F(CoreAPIsStandardTest, AddAndMaterializeLazySymbol) {
R.finalize();
FooMaterialized = true;
},
- [&](const VSO &V, SymbolStringPtr Name) {
+ [&](const JITDylib &JD, SymbolStringPtr Name) {
EXPECT_EQ(Name, Bar) << "Expected Name to be Bar";
BarDiscarded = true;
});
- cantFail(V.define(MU));
- cantFail(V.define(absoluteSymbols({{Bar, BarSym}})));
+ cantFail(JD.define(MU));
+ cantFail(JD.define(absoluteSymbols({{Bar, BarSym}})));
SymbolNameSet Names({Foo});
@@ -521,7 +522,7 @@ TEST_F(CoreAPIsStandardTest, AddAndMaterializeLazySymbol) {
OnReadyRun = true;
};
- ES.lookup({&V}, Names, std::move(OnResolution), std::move(OnReady),
+ ES.lookup({&JD}, Names, std::move(OnResolution), std::move(OnReady),
NoDependenciesToRegister);
EXPECT_TRUE(FooMaterialized) << "Foo was not materialized";
@@ -533,10 +534,10 @@ TEST_F(CoreAPIsStandardTest, AddAndMaterializeLazySymbol) {
TEST_F(CoreAPIsStandardTest, DefineMaterializingSymbol) {
bool ExpectNoMoreMaterialization = false;
ES.setDispatchMaterialization(
- [&](VSO &V, std::unique_ptr<MaterializationUnit> MU) {
+ [&](JITDylib &JD, std::unique_ptr<MaterializationUnit> MU) {
if (ExpectNoMoreMaterialization)
ADD_FAILURE() << "Unexpected materialization";
- MU->doMaterialize(V);
+ MU->doMaterialize(JD);
});
auto MU = llvm::make_unique<SimpleMaterializationUnit>(
@@ -548,27 +549,28 @@ TEST_F(CoreAPIsStandardTest, DefineMaterializingSymbol) {
R.finalize();
});
- cantFail(V.define(MU));
- cantFail(lookup({&V}, Foo));
+ cantFail(JD.define(MU));
+ cantFail(lookup({&JD}, Foo));
// Assert that materialization is complete by now.
ExpectNoMoreMaterialization = true;
// Look up bar to verify that no further materialization happens.
- auto BarResult = cantFail(lookup({&V}, Bar));
+ auto BarResult = cantFail(lookup({&JD}, Bar));
EXPECT_EQ(BarResult.getAddress(), BarSym.getAddress())
<< "Expected Bar == BarSym";
}
TEST_F(CoreAPIsStandardTest, FallbackDefinitionGeneratorTest) {
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
- V.setFallbackDefinitionGenerator([&](VSO &W, const SymbolNameSet &Names) {
- cantFail(W.define(absoluteSymbols({{Bar, BarSym}})));
- return SymbolNameSet({Bar});
- });
+ JD.setFallbackDefinitionGenerator(
+ [&](JITDylib &JD2, const SymbolNameSet &Names) {
+ cantFail(JD2.define(absoluteSymbols({{Bar, BarSym}})));
+ return SymbolNameSet({Bar});
+ });
- auto Result = cantFail(lookup({&V}, {Foo, Bar}));
+ auto Result = cantFail(lookup({&JD}, {Foo, Bar}));
EXPECT_EQ(Result.count(Bar), 1U) << "Expected to find fallback def for 'bar'";
EXPECT_EQ(Result[Bar].getAddress(), BarSym.getAddress())
@@ -581,10 +583,10 @@ TEST_F(CoreAPIsStandardTest, FailResolution) {
{{Foo, JITSymbolFlags::Weak}, {Bar, JITSymbolFlags::Weak}}),
[&](MaterializationResponsibility R) { R.failMaterialization(); });
- cantFail(V.define(MU));
+ cantFail(JD.define(MU));
SymbolNameSet Names({Foo, Bar});
- auto Result = lookup({&V}, Names);
+ auto Result = lookup({&JD}, Names);
EXPECT_FALSE(!!Result) << "Expected failure";
if (!Result) {
@@ -614,9 +616,9 @@ TEST_F(CoreAPIsStandardTest, TestLookupWithUnthreadedMaterialization) {
R.finalize();
});
- cantFail(V.define(MU));
+ cantFail(JD.define(MU));
- auto FooLookupResult = cantFail(lookup({&V}, Foo));
+ auto FooLookupResult = cantFail(lookup({&JD}, Foo));
EXPECT_EQ(FooLookupResult.getAddress(), FooSym.getAddress())
<< "lookup returned an incorrect address";
@@ -629,15 +631,15 @@ TEST_F(CoreAPIsStandardTest, TestLookupWithThreadedMaterialization) {
std::thread MaterializationThread;
ES.setDispatchMaterialization(
- [&](VSO &V, std::unique_ptr<MaterializationUnit> MU) {
+ [&](JITDylib &JD, std::unique_ptr<MaterializationUnit> MU) {
auto SharedMU = std::shared_ptr<MaterializationUnit>(std::move(MU));
MaterializationThread =
- std::thread([SharedMU, &V]() { SharedMU->doMaterialize(V); });
+ std::thread([SharedMU, &JD]() { SharedMU->doMaterialize(JD); });
});
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
- auto FooLookupResult = cantFail(lookup({&V}, Foo));
+ auto FooLookupResult = cantFail(lookup({&JD}, Foo));
EXPECT_EQ(FooLookupResult.getAddress(), FooSym.getAddress())
<< "lookup returned an incorrect address";
@@ -650,7 +652,7 @@ TEST_F(CoreAPIsStandardTest, TestLookupWithThreadedMaterialization) {
TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) {
// Test that GetRequestedSymbols returns the set of symbols that currently
// have pending queries, and test that MaterializationResponsibility's
- // replace method can be used to return definitions to the VSO in a new
+ // replace method can be used to return definitions to the JITDylib in a new
// MaterializationUnit.
SymbolNameSet Names({Foo, Bar});
@@ -680,19 +682,19 @@ TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) {
FooMaterialized = true;
});
- cantFail(V.define(MU));
+ cantFail(JD.define(MU));
EXPECT_FALSE(FooMaterialized) << "Foo should not be materialized yet";
EXPECT_FALSE(BarMaterialized) << "Bar should not be materialized yet";
- auto FooSymResult = cantFail(lookup({&V}, Foo));
+ auto FooSymResult = cantFail(lookup({&JD}, Foo));
EXPECT_EQ(FooSymResult.getAddress(), FooSym.getAddress())
<< "Address mismatch for Foo";
EXPECT_TRUE(FooMaterialized) << "Foo should be materialized now";
EXPECT_FALSE(BarMaterialized) << "Bar still should not be materialized";
- auto BarSymResult = cantFail(lookup({&V}, Bar));
+ auto BarSymResult = cantFail(lookup({&JD}, Bar));
EXPECT_EQ(BarSymResult.getAddress(), BarSym.getAddress())
<< "Address mismatch for Bar";
EXPECT_TRUE(BarMaterialized) << "Bar should be materialized now";
@@ -710,9 +712,9 @@ TEST_F(CoreAPIsStandardTest, TestMaterializationResponsibilityDelegation) {
R2.finalize();
});
- cantFail(V.define(MU));
+ cantFail(JD.define(MU));
- auto Result = lookup({&V}, {Foo, Bar});
+ auto Result = lookup({&JD}, {Foo, Bar});
EXPECT_TRUE(!!Result) << "Result should be a success value";
EXPECT_EQ(Result->count(Foo), 1U) << "\"Foo\" entry missing";
@@ -737,14 +739,14 @@ TEST_F(CoreAPIsStandardTest, TestMaterializeWeakSymbol) {
llvm::make_unique<MaterializationResponsibility>(std::move(R));
});
- cantFail(V.define(MU));
+ cantFail(JD.define(MU));
auto OnResolution = [](Expected<SymbolMap> Result) {
cantFail(std::move(Result));
};
auto OnReady = [](Error Err) { cantFail(std::move(Err)); };
- ES.lookup({&V}, {Foo}, std::move(OnResolution), std::move(OnReady),
+ ES.lookup({&JD}, {Foo}, std::move(OnResolution), std::move(OnReady),
NoDependenciesToRegister);
auto MU2 = llvm::make_unique<SimpleMaterializationUnit>(
@@ -753,7 +755,7 @@ TEST_F(CoreAPIsStandardTest, TestMaterializeWeakSymbol) {
llvm_unreachable("This unit should never be materialized");
});
- auto Err = V.define(MU2);
+ auto Err = JD.define(MU2);
EXPECT_TRUE(!!Err) << "Expected failure value";
EXPECT_TRUE(Err.isA<DuplicateDefinition>())
<< "Expected a duplicate definition error";
diff --git a/llvm/unittests/ExecutionEngine/Orc/LegacyAPIInteropTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LegacyAPIInteropTest.cpp
index 746ae1dca49..05fe921ee96 100644
--- a/llvm/unittests/ExecutionEngine/Orc/LegacyAPIInteropTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/LegacyAPIInteropTest.cpp
@@ -19,12 +19,12 @@ class LegacyAPIsStandardTest : public CoreAPIsBasedStandardTest {};
namespace {
TEST_F(LegacyAPIsStandardTest, TestLambdaSymbolResolver) {
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}, {Bar, BarSym}})));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}, {Bar, BarSym}})));
auto Resolver = createSymbolResolver(
- [&](const SymbolNameSet &Symbols) { return V.lookupFlags(Symbols); },
+ [&](const SymbolNameSet &Symbols) { return JD.lookupFlags(Symbols); },
[&](std::shared_ptr<AsynchronousSymbolQuery> Q, SymbolNameSet Symbols) {
- return V.legacyLookup(std::move(Q), Symbols);
+ return JD.legacyLookup(std::move(Q), Symbols);
});
SymbolNameSet Symbols({Foo, Bar, Baz});
@@ -66,22 +66,22 @@ TEST_F(LegacyAPIsStandardTest, TestLambdaSymbolResolver) {
EXPECT_TRUE(OnResolvedRun) << "OnResolved was never run";
}
-TEST(LegacyAPIInteropTest, QueryAgainstVSO) {
+TEST(LegacyAPIInteropTest, QueryAgainstJITDylib) {
ExecutionSession ES(std::make_shared<SymbolStringPool>());
auto Foo = ES.getSymbolStringPool().intern("foo");
- auto &V = ES.createVSO("V");
+ auto &JD = ES.createJITDylib("JD");
JITEvaluatedSymbol FooSym(0xdeadbeef, JITSymbolFlags::Exported);
- cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
+ cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
auto LookupFlags = [&](const SymbolNameSet &Names) {
- return V.lookupFlags(Names);
+ return JD.lookupFlags(Names);
};
auto Lookup = [&](std::shared_ptr<AsynchronousSymbolQuery> Query,
SymbolNameSet Symbols) {
- return V.legacyLookup(std::move(Query), Symbols);
+ return JD.legacyLookup(std::move(Query), Symbols);
};
auto UnderlyingResolver =
diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
index c6caaf07db0..05a0b11b866 100644
--- a/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
@@ -44,12 +44,12 @@ namespace orc {
// (4) FooSym, BarSym, BazSym, QuxSym -- JITEvaluatedSymbols with FooAddr,
// BarAddr, BazAddr, and QuxAddr respectively. All with default strong,
// linkage and non-hidden visibility.
-// (5) V -- A VSO associated with ES.
+// (5) V -- A JITDylib associated with ES.
class CoreAPIsBasedStandardTest : public testing::Test {
public:
protected:
ExecutionSession ES;
- VSO &V = ES.createVSO("V");
+ JITDylib &JD = ES.createJITDylib("JD");
SymbolStringPtr Foo = ES.getSymbolStringPool().intern("foo");
SymbolStringPtr Bar = ES.getSymbolStringPool().intern("bar");
SymbolStringPtr Baz = ES.getSymbolStringPool().intern("baz");
OpenPOWER on IntegriCloud