From f27a2d85ceca2978bafcaeb583b0ad9eb62a7f5f Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Fri, 4 Nov 2016 22:29:34 +0000 Subject: [PATCH] [ExecutionEngine] Document the insane ownership contract for ExecutionEngine::removeModule. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286026 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/ExecutionEngine.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index 7b33bd91cfc..f68337c4327 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -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 -- 2.40.0