forked from OSchip/llvm-project
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:
parent
fdb3df65b6
commit
7a3da86823
llvm/include/llvm/ExecutionEngine/Orc
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue