From 7a9034c4db248fe8b8cb82762881b51b221988d3 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Tue, 27 Oct 2009 00:03:05 +0000 Subject: Automatically do the equivalent of freeMachineCodeForFunction(F) when F is being destroyed. This allows users to run global optimizations like globaldce even after some functions have been jitted. This patch also removes the Function* parameter to JITEventListener::NotifyFreeingMachineCode() since it can cause that to be called when the Function is partially destroyed. This change will be even more helpful later when I think we'll want to allow machine code to actually outlive its Function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85182 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/ExecutionEngine.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/llvm/ExecutionEngine/ExecutionEngine.h') diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index 92f552de0e..b5b664d5eb 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -263,9 +263,8 @@ public: /// getPointerToFunction - The different EE's represent function bodies in /// different ways. They should each implement this to say what a function /// pointer should look like. When F is destroyed, the ExecutionEngine will - /// remove its global mapping but will not yet free its machine code. Call - /// freeMachineCodeForFunction(F) explicitly to do that. Note that global - /// optimizations can destroy Functions without notifying the ExecutionEngine. + /// remove its global mapping and free any machine code. Be sure no threads + /// are running inside F when that happens. /// virtual void *getPointerToFunction(Function *F) = 0; -- cgit v1.2.3-70-g09d2