[llvm-commits] [llvm-gcc-4.0] r41764 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Anton Korobeynikov asl at math.spbu.ru
Fri Sep 7 04:41:02 PDT 2007


Author: asl
Date: Fri Sep  7 06:41:01 2007
New Revision: 41764

URL: http://llvm.org/viewvc/llvm-project?rev=41764&view=rev
Log:
Frontend support for new eh intrinsics

Modified:
    llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=41764&r1=41763&r2=41764&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Fri Sep  7 06:41:01 2007
@@ -2091,19 +2091,25 @@
 void TreeToLLVM::CreateExceptionValues() {
   // Check to see if the exception values have been constructed.
   if (ExceptionValue) return;
+
+  const Type *IntPtr = TD.getIntPtrType();
   
   ExceptionValue = CreateTemporary(PointerType::get(Type::Int8Ty));
   ExceptionValue->setName("eh_exception");
   
-  ExceptionSelectorValue = CreateTemporary(Type::Int32Ty);
+  ExceptionSelectorValue = CreateTemporary(IntPtr);
   ExceptionSelectorValue->setName("eh_selector");
   
   FuncEHException = Intrinsic::getDeclaration(TheModule,
                                               Intrinsic::eh_exception);
   FuncEHSelector  = Intrinsic::getDeclaration(TheModule,
-                                              Intrinsic::eh_selector);
+                                              (IntPtr == Type::Int32Ty ?
+                                               Intrinsic::eh_selector_i32 :
+                                               Intrinsic::eh_selector_i64));
   FuncEHGetTypeID = Intrinsic::getDeclaration(TheModule,
-                                              Intrinsic::eh_typeid_for);
+                                              (IntPtr == Type::Int32Ty ?
+                                               Intrinsic::eh_typeid_for_i32 :
+                                               Intrinsic::eh_typeid_for_i64));
                                                       
   FuncCPPPersonality =
     TheModule->getOrInsertFunction("__gxx_personality_v0",





More information about the llvm-commits mailing list