[llvm] r286026 - [ExecutionEngine] Document the insane ownership contract for

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 15:29:34 PDT 2016


Author: lhames
Date: Fri Nov  4 17:29:34 2016
New Revision: 286026

URL: http://llvm.org/viewvc/llvm-project?rev=286026&view=rev
Log:
[ExecutionEngine] Document the insane ownership contract for
ExecutionEngine::removeModule.


Modified:
    llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h

Modified: llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h?rev=286026&r1=286025&r2=286026&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h Fri Nov  4 17:29:34 2016
@@ -198,8 +198,12 @@ public:
 
   const DataLayout &getDataLayout() const { return DL; }
 
-  /// removeModule - Remove a Module from the list of modules.  Returns true if
-  /// M is found.
+  /// removeModule - Removes a Module from the list of modules, but does not
+  /// free the module's memory. Returns true if M is found, in which case the
+  /// caller assumes responsibility for deleting the module.
+  //
+  // FIXME: This stealth ownership transfer is horrible. This will probably be
+  //        fixed by deleting ExecutionEngine.
   virtual bool removeModule(Module *M);
 
   /// FindFunctionNamed - Search all of the active modules to find the function that




More information about the llvm-commits mailing list