[llvm] r310906 - Propagate error in LazyEmittingLayer::removeModule.
Hans Wennborg via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 17 10:34:33 PDT 2017
Merged to 5.0 in r311107.
On Mon, Aug 14, 2017 at 7:25 PM, Frederich Munch via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: marsupial
> Date: Mon Aug 14 19:25:36 2017
> New Revision: 310906
>
> URL: http://llvm.org/viewvc/llvm-project?rev=310906&view=rev
> Log:
> 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
>
> Modified:
> llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
>
> Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h?rev=310906&r1=310905&r2=310906&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h (original)
> +++ llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h Mon Aug 14 19:25:36 2017
> @@ -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.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list