Skip to content

Commit faa4dac

Browse files
author
Frederich Munch
committed
Propagate error in LazyEmittingLayer::removeModule.
Summary: Besides being the better thing to do, not doing so will triggers an assert with LLVM_ENABLE_ABI_BREAKING_CHECKS. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36700 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310906 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 822b8da commit faa4dac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ template <typename BaseLayerT> class LazyEmittingLayer {
9494
llvm_unreachable("Invalid emit-state.");
9595
}
9696

97-
void removeModuleFromBaseLayer(BaseLayerT &BaseLayer) {
98-
if (EmitState != NotEmitted)
99-
BaseLayer.removeModule(Handle);
97+
Error removeModuleFromBaseLayer(BaseLayerT& BaseLayer) {
98+
return EmitState != NotEmitted ? BaseLayer.removeModule(Handle)
99+
: Error::success();
100100
}
101101

102102
void emitAndFinalize(BaseLayerT &BaseLayer) {
@@ -226,9 +226,9 @@ template <typename BaseLayerT> class LazyEmittingLayer {
226226
/// This method will free the memory associated with the given module, both
227227
/// in this layer, and the base layer.
228228
Error removeModule(ModuleHandleT H) {
229-
(*H)->removeModuleFromBaseLayer(BaseLayer);
229+
Error Err = (*H)->removeModuleFromBaseLayer(BaseLayer);
230230
ModuleList.erase(H);
231-
return Error::success();
231+
return Err;
232232
}
233233

234234
/// @brief Search for the given named symbol.

0 commit comments

Comments
 (0)