[PATCH] D36700: Propagate error in LazyEmittingLayer::removeModule.

Frederich Munch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 19:28:45 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL310906: Propagate error in LazyEmittingLayer::removeModule. (authored by marsupial).

Changed prior to commit:
  https://reviews.llvm.org/D36700?vs=111031&id=111112#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D36700

Files:
  llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36700.111112.patch
Type: text/x-patch
Size: 1162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170815/49012b90/attachment.bin>


More information about the llvm-commits mailing list