Index: llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h =================================================================== --- llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h +++ llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h @@ -94,9 +94,9 @@ 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 @@ /// 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.