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

llvm-svn: 310906
This commit is contained in:
Frederich Munch 2017-08-15 02:25:36 +00:00
parent fdb3df65b6
commit 7a3da86823
1 changed files with 5 additions and 5 deletions
llvm/include/llvm/ExecutionEngine/Orc

View File

@ -94,9 +94,9 @@ private:
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) {
@ -226,9 +226,9 @@ public:
/// 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.