[llvm-commits] [llvm-gcc-4.2] r55961 - in /llvm-gcc-4.2/trunk: README.LLVM gcc/llvm-convert.cpp

Anton Korobeynikov asl at math.spbu.ru
Mon Sep 8 14:16:43 PDT 2008


Author: asl
Date: Mon Sep  8 16:16:42 2008
New Revision: 55961

URL: http://llvm.org/viewvc/llvm-project?rev=55961&view=rev
Log:
Reapply 55909.

Modified:
    llvm-gcc-4.2/trunk/README.LLVM
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/README.LLVM
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=55961&r1=55960&r2=55961&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/README.LLVM (original)
+++ llvm-gcc-4.2/trunk/README.LLVM Mon Sep  8 16:16:42 2008
@@ -150,12 +150,18 @@
     --enable-llvm=$LLVMOBJDIR --enable-languages=c,c++$EXTRALANGS $TARGETOPTIONS
 $ make $BUILDOPTIONS
 $ make install
+
+//===-----------------------
+Darwin/Mac OS X Specific part:
+
 $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib
 $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib/libstdc++.dylib
 
 That last step, "ln -sf ..." is required so that the linker (collect2) can find
 libstdc++ ('-lstdc++') and subsequently link C++ executables correctly.
 
+//===-----------------------
+
 Note that if you prefer to bootstrap llvm-gcc (so that the final llvm-gcc 
 executables have been compiled with llvm-gcc itself), replace "make" with
 "make bootstrap".

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=55961&r1=55960&r2=55961&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Sep  8 16:16:42 2008
@@ -5273,9 +5273,10 @@
 
   int cfa_offset = ARG_POINTER_CFA_OFFSET(exp);
 
+  // FIXME: is i32 always enough here?
   Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
-                                                      Intrinsic::eh_dwarf_cfa),
-                              ConstantInt::get(Type::Int32Ty, cfa_offset));
+							Intrinsic::eh_dwarf_cfa),
+			      ConstantInt::get(Type::Int32Ty, cfa_offset));
 
   return true;
 }
@@ -5324,17 +5325,21 @@
   if (!validate_arglist(arglist, INTEGER_TYPE, POINTER_TYPE, VOID_TYPE))
     return false;
 
+  const Type *IntPtr = TD.getIntPtrType();
   Value *Offset = Emit(TREE_VALUE(arglist), 0);
   Value *Handler = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0);
-  Offset = Builder.CreateIntCast(Offset, Type::Int32Ty, true);
+
+  Intrinsic::ID IID = (IntPtr == Type::Int32Ty ?
+		       Intrinsic::eh_return_i32 : Intrinsic::eh_return_i64);
+
+  Offset = Builder.CreateIntCast(Offset, IntPtr, true);
   Handler = BitCastToType(Handler, PointerType::getUnqual(Type::Int8Ty));
 
   SmallVector<Value *, 2> Args;
   Args.push_back(Offset);
   Args.push_back(Handler);
-  Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
-                                               Intrinsic::eh_return),
-                     Args.begin(), Args.end());
+  Builder.CreateCall(Intrinsic::getDeclaration(TheModule, IID),
+		     Args.begin(), Args.end());
   Result = Builder.CreateUnreachable();
   EmitBlock(BasicBlock::Create(""));
 





More information about the llvm-commits mailing list