aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/ExecutionEngine/JITMemoryManager.h
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-10-20 18:13:21 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-10-20 18:13:21 +0000
commit1e8613212286a8066001c8a3f516da89d250e05d (patch)
tree54e080388248880f4bdad668c8963483f7470f03 /include/llvm/ExecutionEngine/JITMemoryManager.h
parentf7a0c0de6d73df8f24438234485b7950323b3d44 (diff)
Move the Function*->allocated blocks map from the JITMemoryManager to the
JITEmitter. I'm gradually making Functions auto-remove themselves from the JIT when they're destroyed. In this case, the Function needs to be removed from the JITEmitter, but the map recording which Functions need to be removed lived behind the JITMemoryManager interface, which made things difficult. This patch replaces the deallocateMemForFunction(Function*) method with a pair of methods deallocateFunctionBody(void *) and deallocateExceptionTable(void *) corresponding to the two startFoo/endFoo pairs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ExecutionEngine/JITMemoryManager.h')
-rw-r--r--include/llvm/ExecutionEngine/JITMemoryManager.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/llvm/ExecutionEngine/JITMemoryManager.h b/include/llvm/ExecutionEngine/JITMemoryManager.h
index 9f6fb63fbe..568518898c 100644
--- a/include/llvm/ExecutionEngine/JITMemoryManager.h
+++ b/include/llvm/ExecutionEngine/JITMemoryManager.h
@@ -132,9 +132,11 @@ public:
///
virtual uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment) = 0;
- /// deallocateMemForFunction - Free JIT memory for the specified function.
- /// This is never called when the JIT is currently emitting a function.
- virtual void deallocateMemForFunction(const Function *F) = 0;
+ /// deallocateFunctionBody - Free the specified function body. The argument
+ /// must be the return value from a call to startFunctionBody() that hasn't
+ /// been deallocated yet. This is never called when the JIT is currently
+ /// emitting a function.
+ virtual void deallocateFunctionBody(void *Body) = 0;
/// startExceptionTable - When we finished JITing the function, if exception
/// handling is set, we emit the exception table.
@@ -146,6 +148,12 @@ public:
virtual void endExceptionTable(const Function *F, uint8_t *TableStart,
uint8_t *TableEnd, uint8_t* FrameRegister) = 0;
+ /// deallocateExceptionTable - Free the specified exception table's memory.
+ /// The argument must be the return value from a call to startExceptionTable()
+ /// that hasn't been deallocated yet. This is never called when the JIT is
+ /// currently emitting an exception table.
+ virtual void deallocateExceptionTable(void *ET) = 0;
+
/// CheckInvariants - For testing only. Return true if all internal
/// invariants are preserved, or return false and set ErrorStr to a helpful
/// error message.