diff options
| author | Jeffrey Yasskin <jyasskin@google.com> | 2009-10-27 00:03:05 +0000 |
|---|---|---|
| committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-10-27 00:03:05 +0000 |
| commit | bf43f6543d267fcaf1e00bdc9277092d04f461b0 (patch) | |
| tree | 68e58cf8e82ea9b848a0422d5b6d023ce30f269f /llvm/lib/ExecutionEngine/JIT/JIT.cpp | |
| parent | 762195bd01abfd14476f984fbe730a944c4bcd86 (diff) | |
| download | bcm5719-llvm-bf43f6543d267fcaf1e00bdc9277092d04f461b0.tar.gz bcm5719-llvm-bf43f6543d267fcaf1e00bdc9277092d04f461b0.zip | |
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.
llvm-svn: 85182
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/JIT.cpp')
| -rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JIT.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp index cb825904cc2..6b1464e5f29 100644 --- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp @@ -556,10 +556,10 @@ void JIT::NotifyFunctionEmitted( } } -void JIT::NotifyFreeingMachineCode(const Function &F, void *OldPtr) { +void JIT::NotifyFreeingMachineCode(void *OldPtr) { MutexGuard locked(lock); for (unsigned I = 0, S = EventListeners.size(); I < S; ++I) { - EventListeners[I]->NotifyFreeingMachineCode(F, OldPtr); + EventListeners[I]->NotifyFreeingMachineCode(OldPtr); } } |

