aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ExecutionEngine
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ExecutionEngine')
-rw-r--r--include/llvm/ExecutionEngine/ExecutionEngine.h18
-rw-r--r--include/llvm/ExecutionEngine/JITMemoryManager.h11
2 files changed, 29 insertions, 0 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h
index f2249ec..461efe3 100644
--- a/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ b/include/llvm/ExecutionEngine/ExecutionEngine.h
@@ -85,6 +85,11 @@ protected:
/// pointer is invoked to create it. If this returns null, the JIT will abort.
void* (*LazyFunctionCreator)(const std::string &);
+ /// ExceptionTableRegister - If Exception Handling is set, the JIT will
+ /// register dwarf tables with this function
+ typedef void (*EERegisterFn)(void*);
+ static EERegisterFn ExceptionTableRegister;
+
public:
/// lock - This lock is protects the ExecutionEngine, JIT, JITResolver and
/// JITEmitter classes. It must be held while changing the internal state of
@@ -246,6 +251,19 @@ public:
void InstallLazyFunctionCreator(void* (*P)(const std::string &)) {
LazyFunctionCreator = P;
}
+
+ /// InstallExceptionTableRegister - The JIT will use the given function
+ /// to register the exception tables it generates.
+ static void InstallExceptionTableRegister(void (*F)(void*)) {
+ ExceptionTableRegister = F;
+ }
+
+ /// RegisterTable - Registers the given pointer as an exception table. It uses
+ /// the ExceptionTableRegister function.
+ static void RegisterTable(void* res) {
+ if (ExceptionTableRegister)
+ ExceptionTableRegister(res);
+ }
protected:
explicit ExecutionEngine(ModuleProvider *P);
diff --git a/include/llvm/ExecutionEngine/JITMemoryManager.h b/include/llvm/ExecutionEngine/JITMemoryManager.h
index c41be79..7226496 100644
--- a/include/llvm/ExecutionEngine/JITMemoryManager.h
+++ b/include/llvm/ExecutionEngine/JITMemoryManager.h
@@ -89,6 +89,17 @@ public:
/// 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;
+
+ /// startExceptionTable - When we finished JITing the function, if exception
+ /// handling is set, we emit the exception table.
+ virtual unsigned char* startExceptionTable(const Function* F,
+ uintptr_t &ActualSize) = 0;
+
+ /// endExceptionTable - This method is called when the JIT is done emitting
+ /// the exception table.
+ virtual void endExceptionTable(const Function *F, unsigned char *TableStart,
+ unsigned char *TableEnd,
+ unsigned char* FrameRegister) = 0;
};
} // end namespace llvm.