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 /include | |
parent | ba3f88100792b020f69ad1e44ec8c784407435a4 (diff) | |
download | llvm-b35fd448cea32da671ecd3ecaad3cc637598c6e0.tar.gz llvm-b35fd448cea32da671ecd3ecaad3cc637598c6e0.tar.bz2 llvm-b35fd448cea32da671ecd3ecaad3cc637598c6e0.tar.xz |
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 'include')
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index 3287b39a3c..752c92f47c 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -126,10 +126,12 @@ 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 + /// ExceptionTableRegister - If Exception Handling is set, the JIT will + /// register dwarf tables with this function. typedef void (*EERegisterFn)(void*); - static EERegisterFn ExceptionTableRegister; + EERegisterFn ExceptionTableRegister; + EERegisterFn ExceptionTableDeregister; + std::vector<void*> AllExceptionTables; public: /// lock - This lock is protects the ExecutionEngine, JIT, JITResolver and @@ -373,17 +375,26 @@ public: /// InstallExceptionTableRegister - The JIT will use the given function /// to register the exception tables it generates. - static void InstallExceptionTableRegister(void (*F)(void*)) { + void InstallExceptionTableRegister(EERegisterFn F) { ExceptionTableRegister = F; } + void InstallExceptionTableDeregister(EERegisterFn F) { + ExceptionTableDeregister = F; + } /// RegisterTable - Registers the given pointer as an exception table. It uses /// the ExceptionTableRegister function. - static void RegisterTable(void* res) { - if (ExceptionTableRegister) + void RegisterTable(void* res) { + if (ExceptionTableRegister) { ExceptionTableRegister(res); + AllExceptionTables.push_back(res); + } } + /// DeregisterAllTables - Deregisters all previously registered pointers to an + /// exception tables. It uses the ExceptionTableoDeregister function. + void DeregisterAllTables(); + protected: explicit ExecutionEngine(Module *M); |