Skip to content

Commit c67148d

Browse files
committed
[ORC] Add note to call endSession to assertion messages.
The most likely cause of these assertions is a failure to call endSession. The new message should clients spot the issue more easily.
1 parent 4841577 commit c67148d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

llvm/lib/ExecutionEngine/Orc/LinkGraphLinkingLayer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,10 @@ LinkGraphLinkingLayer::LinkGraphLinkingLayer(
499499
}
500500

501501
LinkGraphLinkingLayer::~LinkGraphLinkingLayer() {
502-
assert(Allocs.empty() && "Layer destroyed with resources still attached");
502+
assert(Allocs.empty() &&
503+
"Layer destroyed with resources still attached "
504+
"(ExecutionSession::endSession() must be called prior to "
505+
"destruction)");
503506
getExecutionSession().deregisterResourceManager(*this);
504507
}
505508

llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ RTDyldObjectLinkingLayer::RTDyldObjectLinkingLayer(
8888
}
8989

9090
RTDyldObjectLinkingLayer::~RTDyldObjectLinkingLayer() {
91-
assert(MemMgrs.empty() && "Layer destroyed with resources still attached");
91+
assert(MemMgrs.empty() &&
92+
"Layer destroyed with resources still attached"
93+
"(ExecutionSession::endSession() must be called prior to "
94+
"destruction)");
9295
}
9396

9497
void RTDyldObjectLinkingLayer::emit(

0 commit comments

Comments
 (0)