Implement ExecutionEngine::freeMachineCodeForFunction()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17601 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h
index e146135..8af2361 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -120,6 +120,10 @@
     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<GenericValue> &ArgVals);
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 7596c43..d9866c8 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -330,3 +330,9 @@
   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 414d1c6..b0c26b0 100644
--- a/lib/ExecutionEngine/JIT/JIT.h
+++ b/lib/ExecutionEngine/JIT/JIT.h
@@ -90,6 +90,11 @@
   ///
   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);