Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/ExecutionEngine/Orc/Core.cpp
Show First 20 Lines • Show All 486 Lines • ▼ Show 20 Lines | |||||
StringRef AbsoluteSymbolsMaterializationUnit::getName() const { | StringRef AbsoluteSymbolsMaterializationUnit::getName() const { | ||||
return "<Absolute Symbols>"; | return "<Absolute Symbols>"; | ||||
} | } | ||||
void AbsoluteSymbolsMaterializationUnit::materialize( | void AbsoluteSymbolsMaterializationUnit::materialize( | ||||
MaterializationResponsibility R) { | MaterializationResponsibility R) { | ||||
// No dependencies, so these calls can't fail. | // No dependencies, so these calls can't fail. | ||||
cantFail(R.notifyResolved(Symbols)); | llvm_cantFail(R.notifyResolved(Symbols)); | ||||
cantFail(R.notifyEmitted()); | llvm_cantFail(R.notifyEmitted()); | ||||
} | } | ||||
void AbsoluteSymbolsMaterializationUnit::discard(const JITDylib &JD, | void AbsoluteSymbolsMaterializationUnit::discard(const JITDylib &JD, | ||||
const SymbolStringPtr &Name) { | const SymbolStringPtr &Name) { | ||||
assert(Symbols.count(Name) && "Symbol is not part of this MU"); | assert(Symbols.count(Name) && "Symbol is not part of this MU"); | ||||
Symbols.erase(Name); | Symbols.erase(Name); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | ReexportsGenerator::tryToGenerate(JITDylib &JD, const SymbolNameSet &Names) { | ||||
for (auto &KV : *Flags) { | for (auto &KV : *Flags) { | ||||
if (Allow && !Allow(KV.first)) | if (Allow && !Allow(KV.first)) | ||||
continue; | continue; | ||||
AliasMap[KV.first] = SymbolAliasMapEntry(KV.first, KV.second); | AliasMap[KV.first] = SymbolAliasMapEntry(KV.first, KV.second); | ||||
Added.insert(KV.first); | Added.insert(KV.first); | ||||
} | } | ||||
if (!Added.empty()) | if (!Added.empty()) | ||||
cantFail(JD.define(reexports(SourceJD, AliasMap, MatchNonExported))); | llvm_cantFail(JD.define(reexports(SourceJD, AliasMap, MatchNonExported))); | ||||
return Added; | return Added; | ||||
} | } | ||||
JITDylib::DefinitionGenerator::~DefinitionGenerator() {} | JITDylib::DefinitionGenerator::~DefinitionGenerator() {} | ||||
void JITDylib::removeGenerator(DefinitionGenerator &G) { | void JITDylib::removeGenerator(DefinitionGenerator &G) { | ||||
ES.runSessionLocked([&]() { | ES.runSessionLocked([&]() { | ||||
▲ Show 20 Lines • Show All 688 Lines • ▼ Show 20 Lines | for (auto &DG : DefGenerators) { | ||||
// unresolved symbols then lodge the query against them. | // unresolved symbols then lodge the query against them. | ||||
if (!NewDefs->empty()) { | if (!NewDefs->empty()) { | ||||
for (auto &D : *NewDefs) | for (auto &D : *NewDefs) | ||||
Unresolved.erase(D); | Unresolved.erase(D); | ||||
// Lodge query. This can not fail as any new definitions were added | // Lodge query. This can not fail as any new definitions were added | ||||
// by the generator under the session locked. Since they can't have | // by the generator under the session locked. Since they can't have | ||||
// started materializing yet the can not have failed. | // started materializing yet the can not have failed. | ||||
cantFail(lodgeQueryImpl(Q, *NewDefs, MatchNonExported, MUs)); | llvm_cantFail(lodgeQueryImpl(Q, *NewDefs, MatchNonExported, MUs)); | ||||
assert(NewDefs->empty() && | assert(NewDefs->empty() && | ||||
"All fallback defs should have been found by lookupImpl"); | "All fallback defs should have been found by lookupImpl"); | ||||
} | } | ||||
} | } | ||||
return Error::success(); | return Error::success(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 713 Lines • Show Last 20 Lines |