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);