From 895eddfad43f848d5accce1789aa80be0db459d3 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Sun, 7 Nov 2004 23:58:46 +0000 Subject: [PATCH] Implement ExecutionEngine::freeMachineCodeForFunction() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17601 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/Interpreter/Interpreter.h | 4 ++++ lib/ExecutionEngine/JIT/JIT.cpp | 6 ++++++ lib/ExecutionEngine/JIT/JIT.h | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h index e146135cf5f..8af2361ebae 100644 --- a/lib/ExecutionEngine/Interpreter/Interpreter.h +++ b/lib/ExecutionEngine/Interpreter/Interpreter.h @@ -120,6 +120,10 @@ public: return getPointerToFunction(F); } + /// freeMachineCodeForFunction - The interpreter does not generate any code. + /// + void freeMachineCodeForFunction(Function *F) { } + // Methods used to execute code: // Place a call on the stack void callFunction(Function *F, const std::vector &ArgVals); diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 7596c437973..d9866c87ee4 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -330,3 +330,9 @@ void *JIT::recompileAndRelinkFunction(Function *F) { TJI.replaceMachineCodeForFunction(OldAddr, Addr); return Addr; } + +/// freeMachineCodeForFunction - release machine code memory for given Function +/// +void JIT::freeMachineCodeForFunction(Function *F) { + // currently a no-op +} diff --git a/lib/ExecutionEngine/JIT/JIT.h b/lib/ExecutionEngine/JIT/JIT.h index 414d1c6e683..b0c26b0d2cc 100644 --- a/lib/ExecutionEngine/JIT/JIT.h +++ b/lib/ExecutionEngine/JIT/JIT.h @@ -90,6 +90,11 @@ public: /// void *recompileAndRelinkFunction(Function *F); + /// freeMachineCodeForFunction - deallocate memory used to code-generate this + /// Function. + /// + void freeMachineCodeForFunction(Function *F); + private: static MachineCodeEmitter *createEmitter(JIT &J); void runJITOnFunction (Function *F);