diff options
author | Duncan Sands <baldrick@free.fr> | 2010-10-21 08:57:29 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-10-21 08:57:29 +0000 |
commit | b35fd448cea32da671ecd3ecaad3cc637598c6e0 (patch) | |
tree | 7ffc445a977f1c5664f02ebe509dfbda9f32849e /lib/ExecutionEngine/JIT/JIT.cpp | |
parent | ba3f88100792b020f69ad1e44ec8c784407435a4 (diff) |
Fix the cleanup process of exception information in JIT. Now JIT
deregisters registered by it FDE structures allowing consecutive
JIT runs to succeed. Patch by Yuri. Fixes PR8285.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 63125b79c8..8104ab995a 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -87,6 +87,7 @@ extern "C" void LLVMLinkInJIT() { // values of an opaque key, used by libgcc to find dwarf tables. extern "C" void __register_frame(void*); +extern "C" void __deregister_frame(void*); #if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 # define USE_KEYMGR 1 @@ -318,8 +319,10 @@ JIT::JIT(Module *M, TargetMachine &tm, TargetJITInfo &tji, LOI = (LibgccObjectInfo*)calloc(sizeof(struct LibgccObjectInfo), 1); _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST, LOI); InstallExceptionTableRegister(DarwinRegisterFrame); + // Not sure about how to deregister on Darwin. #else InstallExceptionTableRegister(__register_frame); + InstallExceptionTableDeregister(__deregister_frame); #endif // __APPLE__ #endif // __GNUC__ @@ -328,6 +331,9 @@ JIT::JIT(Module *M, TargetMachine &tm, TargetJITInfo &tji, } JIT::~JIT() { + // Unregister all exception tables registered by this JIT. + DeregisterAllTables(); + // Cleanup. AllJits->Remove(this); delete jitstate; delete JCE; |