llvm.org GIT mirror llvm / faa4dac
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 Frederich Munch 2 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
9393 llvm_unreachable("Invalid emit-state.");
9494 }
9595
96 void removeModuleFromBaseLayer(BaseLayerT &BaseLayer) {
97 if (EmitState != NotEmitted)
98 BaseLayer.removeModule(Handle);
96 Error removeModuleFromBaseLayer(BaseLayerT& BaseLayer) {
97 return EmitState != NotEmitted ? BaseLayer.removeModule(Handle)
98 : Error::success();
9999 }
100100
101101 void emitAndFinalize(BaseLayerT &BaseLayer) {
225225 /// This method will free the memory associated with the given module, both
226226 /// in this layer, and the base layer.
227227 Error removeModule(ModuleHandleT H) {
228 (*H)->removeModuleFromBaseLayer(BaseLayer);
228 Error Err = (*H)->removeModuleFromBaseLayer(BaseLayer);
229229 ModuleList.erase(H);
230 return Error::success();
230 return Err;
231231 }
232232
233233 /// @brief Search for the given named symbol.