EXPECT_FALSE(OnCompletionRun) << "Should not have been resolved yet";
- FooMR->resolve({{Foo, FooSym}});
+ FooMR->notifyResolved({{Foo, FooSym}});
EXPECT_FALSE(OnCompletionRun) << "Should not be ready yet";
- FooMR->emit();
+ FooMR->notifyEmitted();
EXPECT_TRUE(OnCompletionRun) << "Should have been marked ready";
}
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[this](MaterializationResponsibility R) {
ADD_FAILURE() << "Unexpected materialization of \"Bar\"";
- R.resolve({{Bar, BarSym}});
- R.emit();
+ R.notifyResolved({{Bar, BarSym}});
+ R.notifyEmitted();
},
[&](const JITDylib &JD, const SymbolStringPtr &Name) {
EXPECT_EQ(Name, Bar) << "Expected \"Bar\" to be discarded";
consumeError(std::move(Err));
}
- BazR->resolve({{Baz, BazSym}});
- BazR->emit();
+ BazR->notifyResolved({{Baz, BazSym}});
+ BazR->notifyEmitted();
{
// Attempt 3: Search now that all symbols are fully materialized
// (Foo, Baz), or not yet materialized (Bar).
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
BarMaterialized = true;
- R.resolve({{Bar, BarSym}});
- R.emit();
+ R.notifyResolved({{Bar, BarSym}});
+ R.notifyEmitted();
});
cantFail(JD.define(BarMU));
ES.lookup(JITDylibSearchList({{&JD, false}}), {Foo}, SymbolState::Ready,
OnCompletion, NoDependenciesToRegister);
- FooR->resolve({{Foo, FooSym}});
- FooR->emit();
+ FooR->notifyResolved({{Foo, FooSym}});
+ FooR->notifyEmitted();
EXPECT_TRUE(FooReady)
<< "Self-dependency prevented symbol from being marked ready";
EXPECT_FALSE(BazResolved) << "\"Baz\" should not be resolved yet";
// Resolve the symbols (but do not emit them).
- FooR->resolve({{Foo, FooSym}});
- BarR->resolve({{Bar, BarSym}});
- BazR->resolve({{Baz, BazSym}});
+ FooR->notifyResolved({{Foo, FooSym}});
+ BarR->notifyResolved({{Bar, BarSym}});
+ BazR->notifyResolved({{Baz, BazSym}});
// Verify that the symbols have been resolved, but are not ready yet.
EXPECT_TRUE(FooResolved) << "\"Foo\" should be resolved now";
EXPECT_FALSE(BazReady) << "\"Baz\" should not be ready yet";
// Emit two of the symbols.
- FooR->emit();
- BarR->emit();
+ FooR->notifyEmitted();
+ BarR->notifyEmitted();
// Verify that nothing is ready until the circular dependence is resolved.
EXPECT_FALSE(FooReady) << "\"Foo\" still should not be ready";
EXPECT_FALSE(BazReady) << "\"Baz\" still should not be ready";
// Emit the last symbol.
- BazR->emit();
+ BazR->notifyEmitted();
// Verify that everything becomes ready once the circular dependence resolved.
EXPECT_TRUE(FooReady) << "\"Foo\" should be ready now";
SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}, {Bar, WeakExported}}),
[&](MaterializationResponsibility R) {
assert(BarDiscarded && "Bar should have been discarded by this point");
- R.resolve(SymbolMap({{Foo, FooSym}}));
- R.emit();
+ R.notifyResolved(SymbolMap({{Foo, FooSym}}));
+ R.notifyEmitted();
FooMaterialized = true;
},
[&](const JITDylib &JD, SymbolStringPtr Name) {
auto MU1 = llvm::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
- R.resolve(SymbolMap({{Foo, FooSym}, {Bar, BarSym}})), R.emit();
+ R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}})), R.notifyEmitted();
BarMaterialized = true;
});
[&](MaterializationResponsibility R) {
cantFail(
R.defineMaterializing(SymbolFlagsMap({{Bar, BarSym.getFlags()}})));
- R.resolve(SymbolMap({{Foo, FooSym}, {Bar, BarSym}}));
- R.emit();
+ R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}}));
+ R.notifyEmitted();
});
cantFail(JD.define(MU));
auto MU = llvm::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
- R.resolve(SymbolMap({{Foo, FooSym}, {Bar, BarSym}}));
+ R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}}));
ES.lookup(
JITDylibSearchList({{&JD, false}}), SymbolNameSet({Baz}),
auto MU = llvm::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}}),
[&](MaterializationResponsibility R) {
- R.resolve({{Foo, FooSym}});
- R.emit();
+ R.notifyResolved({{Foo, FooSym}});
+ R.notifyEmitted();
});
cantFail(JD.define(MU));
auto NewMU = llvm::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R2) {
- R2.resolve(SymbolMap({{Bar, BarSym}}));
- R2.emit();
+ R2.notifyResolved(SymbolMap({{Bar, BarSym}}));
+ R2.notifyEmitted();
BarMaterialized = true;
});
R.replace(std::move(NewMU));
- R.resolve(SymbolMap({{Foo, FooSym}}));
- R.emit();
+ R.notifyResolved(SymbolMap({{Foo, FooSym}}));
+ R.notifyEmitted();
FooMaterialized = true;
});
[&](MaterializationResponsibility R) {
auto R2 = R.delegate({Bar});
- R.resolve({{Foo, FooSym}});
- R.emit();
- R2.resolve({{Bar, BarSym}});
- R2.emit();
+ R.notifyResolved({{Foo, FooSym}});
+ R.notifyEmitted();
+ R2.notifyResolved({{Bar, BarSym}});
+ R2.notifyEmitted();
});
cantFail(JD.define(MU));
<< "Expected a duplicate definition error";
consumeError(std::move(Err));
- FooResponsibility->resolve(SymbolMap({{Foo, FooSym}}));
- FooResponsibility->emit();
+ FooResponsibility->notifyResolved(SymbolMap({{Foo, FooSym}}));
+ FooResponsibility->notifyEmitted();
}
} // namespace