From b35fd448cea32da671ecd3ecaad3cc637598c6e0 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Thu, 21 Oct 2010 08:57:29 +0000 Subject: 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 --- lib/ExecutionEngine/ExecutionEngine.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp') diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index be7f1f56a9..77082c4d04 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -47,12 +47,12 @@ ExecutionEngine *(*ExecutionEngine::JITCtor)( const SmallVectorImpl& MAttrs) = 0; ExecutionEngine *(*ExecutionEngine::InterpCtor)(Module *M, std::string *ErrorStr) = 0; -ExecutionEngine::EERegisterFn ExecutionEngine::ExceptionTableRegister = 0; - ExecutionEngine::ExecutionEngine(Module *M) : EEState(*this), - LazyFunctionCreator(0) { + LazyFunctionCreator(0), + ExceptionTableRegister(0), + ExceptionTableDeregister(0) { CompilingLazily = false; GVCompilationDisabled = false; SymbolSearchingDisabled = false; @@ -66,6 +66,16 @@ ExecutionEngine::~ExecutionEngine() { delete Modules[i]; } +void ExecutionEngine::DeregisterAllTables() { + if (ExceptionTableDeregister) { + std::vector::iterator it = AllExceptionTables.begin(); + std::vector::iterator ite = AllExceptionTables.end(); + for (; it != ite; ++it) + ExceptionTableDeregister(*it); + AllExceptionTables.clear(); + } +} + namespace { // This class automatically deletes the memory block when the GlobalVariable is // destroyed. -- cgit v1.2.3-18-g5258