[Orc] Make the ObjectLinkingLayer take ownership of object files until
[oota-llvm.git] / include / llvm / ExecutionEngine / Orc / IRCompileLayer.h
index f81af6fb7d074404194b9c37a0815cdbfee10f60..e16ff8d3a392790411c128ee564b282640773567 100644 (file)
@@ -76,7 +76,12 @@ public:
       Buffers.push_back(std::move(Buffer));
     }
 
       Buffers.push_back(std::move(Buffer));
     }
 
-    return BaseLayer.addObjectSet(std::move(Objects), std::move(MM));
+    ModuleSetHandleT H =
+      BaseLayer.addObjectSet(Objects, std::move(MM));
+
+    BaseLayer.takeOwnershipOfBuffers(H, std::move(Buffers));
+
+    return H;
   }
 
   /// @brief Remove the module set associated with the handle H.
   }
 
   /// @brief Remove the module set associated with the handle H.