summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-03-22 08:53:09 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-03-22 08:53:09 +0000
commit299d9d74e9b010c499557380fb6467f5361e141a (patch)
tree851b6931b51cfee5231de59c1cbb39ef4d9b2293 /lib
parent4a0a001e15cce88df8d6190f24426ce37c9f665a (diff)
downloadllvm-299d9d74e9b010c499557380fb6467f5361e141a.tar.gz
llvm-299d9d74e9b010c499557380fb6467f5361e141a.tar.bz2
llvm-299d9d74e9b010c499557380fb6467f5361e141a.tar.xz
Register EH frames emitted in JIT when using gcc unwinding runtime
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 70ee114b77..f92842abdc 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -61,6 +61,10 @@ namespace llvm {
}
}
+#if defined (__GNUC__)
+extern "C" void __register_frame(void*);
+#endif
+
/// createJIT - This is the factory method for creating a JIT for the current
/// machine, it does not fall back to the interpreter. This takes ownership
/// of the module provider.
@@ -70,7 +74,11 @@ ExecutionEngine *ExecutionEngine::createJIT(ModuleProvider *MP,
ExecutionEngine *EE = JIT::createJIT(MP, ErrorStr, JMM);
if (!EE) return 0;
-
+ // Register routine for informing unwinding runtime about new EH frames
+#if defined(__GNUC__)
+ EE->InstallExceptionTableRegister(__register_frame);
+#endif
+
// Make sure we can resolve symbols in the program as well. The zero arg
// to the function tells DynamicLibrary to load the program, not a library.
sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr);