Skip to content

Commit

Permalink
Propagate error in LazyEmittingLayer::removeModule.
Browse files Browse the repository at this point in the history
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

llvm-svn: 310906
  • Loading branch information
Frederich Munch committed Aug 15, 2017
1 parent fdb3df6 commit 7a3da86
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
Expand Up @@ -94,9 +94,9 @@ template <typename BaseLayerT> class LazyEmittingLayer {
llvm_unreachable("Invalid emit-state.");
}

void removeModuleFromBaseLayer(BaseLayerT &BaseLayer) {
if (EmitState != NotEmitted)
BaseLayer.removeModule(Handle);
Error removeModuleFromBaseLayer(BaseLayerT& BaseLayer) {
return EmitState != NotEmitted ? BaseLayer.removeModule(Handle)
: Error::success();
}

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

/// @brief Search for the given named symbol.
Expand Down

0 comments on commit 7a3da86

Please sign in to comment.