From 9464082008be0d10671c10bf6562536d774d8d53 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. llvm-svn: 286026 --- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h index 7b33bd9..f68337c 100644 --- a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/llvm/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.7.4