[llvm-commits] [llvm] r48688 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp

Anton Korobeynikov asl at math.spbu.ru
Sat Mar 22 01:53:10 PDT 2008


Author: asl
Date: Sat Mar 22 03:53:09 2008
New Revision: 48688

URL: http://llvm.org/viewvc/llvm-project?rev=48688&view=rev
Log:
Register EH frames emitted in JIT when using gcc unwinding runtime

Modified:
    llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp

Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=48688&r1=48687&r2=48688&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Sat Mar 22 03:53:09 2008
@@ -61,6 +61,10 @@
   }
 }
 
+#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 *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);





More information about the llvm-commits mailing list