Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/ExecutionEngine/Orc/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ class ExecutionSession {
// FIXME: We should be able to derive FailedSymsForQuery from each query once
// we fix how the detach operation works.
struct EmitQueries {
JITDylib::AsynchronousSymbolQuerySet Updated;
JITDylib::AsynchronousSymbolQuerySet Completed;
JITDylib::AsynchronousSymbolQuerySet Failed;
DenseMap<AsynchronousSymbolQuery *, std::shared_ptr<SymbolDependenceMap>>
FailedSymsForQuery;
Expand Down
17 changes: 13 additions & 4 deletions llvm/lib/ExecutionEngine/Orc/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2901,13 +2901,23 @@ ExecutionSession::IL_emit(MaterializationResponsibility &MR,

for (auto &SN : ER.Ready)
IL_collectQueries(
EQ.Updated, SN->defs(),
EQ.Completed, SN->defs(),
[](JITDylib::SymbolTableEntry &E) { E.setState(SymbolState::Ready); },
[](AsynchronousSymbolQuery &Q, JITDylib &JD,
NonOwningSymbolStringPtr Name, JITDylib::SymbolTableEntry &E) {
Q.notifySymbolMetRequiredState(SymbolStringPtr(Name), E.getSymbol());
});

// std::erase_if is not available in C++17, and llvm::erase_if does not work
// here.
for (auto it = EQ.Completed.begin(), end = EQ.Completed.end(); it != end;) {
if ((*it)->isComplete()) {
++it;
} else {
it = EQ.Completed.erase(it);
}
}

#ifdef EXPENSIVE_CHECKS
verifySessionState("exiting ExecutionSession::IL_emit");
#endif
Expand Down Expand Up @@ -3043,9 +3053,8 @@ Error ExecutionSession::OL_notifyEmitted(
}
}

for (auto &UQ : EmitQueries->Updated)
if (UQ->isComplete())
UQ->handleComplete(*this);
for (auto &UQ : EmitQueries->Completed)
UQ->handleComplete(*this);

// If there are any bad dependencies then return an error.
if (!BadDeps.empty()) {
Expand Down