All,

Attached is a cumulative patch with all changes in the Apple repository
since the mirror's r240 revision. If you haven't applied the various
patches sent in the last few days, this one will be much easier. 

The attached patch also contains one thing that the Apple repository
doesn't have: fixes to i386.h for changes in the result type of
Module::getOrInsertFunction.

This patch compiles/works fine for me on Linux/x86

Reid.
Index: gcc/llvm-convert.cpp
===================================================================
--- gcc/llvm-convert.cpp	(revision 240)
+++ gcc/llvm-convert.cpp	(working copy)
@@ -38,7 +38,6 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/SmallVector.h"
 #include <iostream>
 
 extern "C" {
@@ -210,14 +209,20 @@
     void HandleScalarArgument(const llvm::Type *LLVMTy, tree type) {
       Value *ArgVal = AI;
       if (ArgVal->getType() != LLVMTy) {
-        // If this is just a mismatch between integer types, this could be due
-        // to K&R prototypes, where the forward proto defines the arg as int and
-        // the actual impls is a short or char.
-        assert(ArgVal->getType()->isIntegral() && LLVMTy->isIntegral() &&
-               "Lowerings don't match?");
-        bool isSigned = type == 0 ? true : !TYPE_UNSIGNED(type);
-        ArgVal = CastInst::createIntegerCast(ArgVal, LLVMTy, isSigned,
-                                             NameStack.back(), CurBB);
+        if (isa<PointerType>(ArgVal->getType()) && isa<PointerType>(LLVMTy)) {
+          // If this is GCC being sloppy about pointer types, insert a bitcast.
+          // See PR1083 for an example.
+          ArgVal = new BitCastInst(ArgVal, LLVMTy, "tmp", CurBB);
+        } else {
+          // If this is just a mismatch between integer types, this could be due
+          // to K&R prototypes, where the forward proto defines the arg as int
+          // and the actual impls is a short or char.
+          assert(ArgVal->getType()->isIntegral() && LLVMTy->isIntegral() &&
+                 "Lowerings don't match?");
+          bool isSigned = type == 0 ? true : !TYPE_UNSIGNED(type);
+          ArgVal = CastInst::createIntegerCast(ArgVal, LLVMTy, isSigned,
+                                               NameStack.back(), CurBB);
+        }
       }
       assert(!LocStack.empty());
       Value *Loc = LocStack.back();
@@ -546,32 +551,40 @@
   // Binary Operators
   case LT_EXPR: 
     Result = EmitCompare(exp, ICmpInst::ICMP_ULT, ICmpInst::ICMP_SLT, 
-                         FCmpInst::FCMP_OLT); break;
+                         FCmpInst::FCMP_OLT);
+    break;
   case LE_EXPR:
     Result = EmitCompare(exp, ICmpInst::ICMP_ULE, ICmpInst::ICMP_SLE,
-                         FCmpInst::FCMP_OLE); break;
+                         FCmpInst::FCMP_OLE);
+    break;
   case GT_EXPR:
     Result = EmitCompare(exp, ICmpInst::ICMP_UGT, ICmpInst::ICMP_SGT,
-                         FCmpInst::FCMP_OGT); break;
+                         FCmpInst::FCMP_OGT);
+    break;
   case GE_EXPR:
     Result = EmitCompare(exp, ICmpInst::ICMP_UGE, ICmpInst::ICMP_SGE, 
-                         FCmpInst::FCMP_OGE); break;
+                         FCmpInst::FCMP_OGE);
+    break;
   case EQ_EXPR:
     Result = EmitCompare(exp, ICmpInst::ICMP_EQ, ICmpInst::ICMP_EQ, 
-                         FCmpInst::FCMP_OEQ); break;
+                         FCmpInst::FCMP_OEQ);
+    break;
   case NE_EXPR:
     Result = EmitCompare(exp, ICmpInst::ICMP_NE, ICmpInst::ICMP_NE, 
-                         FCmpInst::FCMP_UNE); break;
+                         FCmpInst::FCMP_UNE);
+    break;
   case UNORDERED_EXPR: 
-    Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_UNO); break;
+    Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_UNO);
+    break;
   case ORDERED_EXPR: 
-    Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_ORD); break;
+    Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_ORD);
+    break;
   case UNLT_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_ULT); break;
   case UNLE_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_ULE); break;
   case UNGT_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_UGT); break;
   case UNGE_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_UGE); break;
   case UNEQ_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_UEQ); break;
-  case LTGT_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_UNE); break;
+  case LTGT_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_ONE); break;
   case PLUS_EXPR: Result = EmitBinOp(exp, DestLoc, Instruction::Add);break;
   case MINUS_EXPR:Result = EmitBinOp(exp, DestLoc, Instruction::Sub);break;
   case MULT_EXPR: Result = EmitBinOp(exp, DestLoc, Instruction::Mul);break;
@@ -931,7 +944,7 @@
 void TreeToLLVM::EmitMemCpy(Value *DestPtr, Value *SrcPtr, Value *Size, 
                             unsigned Align) {
   const Type *SBP = PointerType::get(Type::Int8Ty);
-  static Function *MemCpy = 0;
+  static Constant *MemCpy = 0;
   const Type *IntPtr = TD.getIntPtrType();
   if (!MemCpy) {
     const char *Name = IntPtr == Type::Int32Ty ?
@@ -951,7 +964,7 @@
 void TreeToLLVM::EmitMemMove(Value *DestPtr, Value *SrcPtr, Value *Size, 
                              unsigned Align) {
   const Type *SBP = PointerType::get(Type::Int8Ty);
-  static Function *MemMove = 0;
+  static Constant *MemMove = 0;
   const Type *IntPtr = TD.getIntPtrType();
   if (!MemMove) {
     const char *Name = IntPtr == Type::Int32Ty ?
@@ -970,7 +983,7 @@
 void TreeToLLVM::EmitMemSet(Value *DestPtr, Value *SrcVal, Value *Size, 
                             unsigned Align) {
   const Type *SBP = PointerType::get(Type::Int8Ty);
-  static Function *MemSet = 0;
+  static Constant *MemSet = 0;
   const Type *IntPtr = TD.getIntPtrType();
   if (!MemSet) {
     const char *Name = IntPtr == Type::Int32Ty ?
@@ -2404,32 +2417,9 @@
   }
 
   // Handle floating point comparisons, if we get here.
-  Value *Result = 0;
-  if (FPPred)
-    Result = new FCmpInst(FCmpInst::Predicate(FPPred), LHS, RHS, "tmp", CurBB);
+  Value *Result =
+    new FCmpInst(FCmpInst::Predicate(FPPred), LHS, RHS, "tmp", CurBB);
   
-  if (CmpInst::isUnordered(FCmpInst::Predicate(FPPred))) {
-    static Function *IsUnordF = 0, *IsUnordD = 0;
-    Function *&Callee = LHS->getType() == Type::FloatTy ? IsUnordF : IsUnordD;
-    const char *Name  = LHS->getType() == Type::FloatTy ?
-                         "llvm.isunordered.f32" : "llvm.isunordered.f64";
-    
-    if (Callee == 0)
-      Callee = TheModule->getOrInsertFunction(Name,
-                                              Type::BoolTy, LHS->getType(),
-                                              LHS->getType(), NULL);
-    
-    Value *IsUnord = new CallInst(Callee, LHS, RHS, "tmp", CurBB);
-    if (Result)
-      Result = BinaryOperator::createOr(Result, IsUnord, "tmp", CurBB);
-    else
-      Result = IsUnord;
-    
-    // If this is an ORDERED_EXPR, invert the result of the isunordered call.
-    if (TREE_CODE(exp) == ORDERED_EXPR)
-      Result = BinaryOperator::createNot(Result, "tmp", CurBB);
-  }
-  
   // The GCC type is probably an int, not a bool.
   return CastToUIntType(Result, ConvertType(TREE_TYPE(exp)));
 }
@@ -3139,7 +3129,7 @@
                                  Value *DestLoc, Value *&Result) {
   if (DECL_BUILT_IN_CLASS(fndecl) == BUILT_IN_MD) {
     unsigned FnCode = DECL_FUNCTION_CODE(fndecl);
-    static std::vector<Function*> TargetBuiltinCache;
+    static std::vector<Constant*> TargetBuiltinCache;
     if (TargetBuiltinCache.size() <= FnCode)
       TargetBuiltinCache.resize(FnCode+1);
     
@@ -3339,8 +3329,10 @@
   }
   
   if (*FCache == 0)
-    *FCache = TheModule->getOrInsertFunction(Name, InVal->getType(),
-                                             InVal->getType(), NULL);
+    *FCache = cast<Function>(TheModule->getOrInsertFunction(Name,
+                                                            InVal->getType(),
+                                                            InVal->getType(),
+                                                            NULL));
   Result = new CallInst(*FCache, InVal, "tmp", CurBB);
   
   // The LLVM intrinsics for these return the same type as their operands.  The
@@ -3363,8 +3355,9 @@
   }
   
   if (*FCache == 0)
-    *FCache = TheModule->getOrInsertFunction(Name, Amt->getType(),
-                                             Amt->getType(), NULL);
+    *FCache = cast<Function>(TheModule->getOrInsertFunction(Name,Amt->getType(),
+                                                            Amt->getType(),
+                                                            NULL));
   return new CallInst(*FCache, Amt, "tmp", CurBB);
 }
 
@@ -3377,9 +3370,9 @@
   Value *Pow = Emit(TREE_VALUE(TREE_CHAIN(ArgList)), 0);
   Pow = CastToSIntType(Pow, Type::Int32Ty);
 
-  static Function *Fn32 = 0, *Fn64 = 0;
+  static Constant *Fn32 = 0, *Fn64 = 0;
   const char *Name;
-  Function **FCache;
+  Constant **FCache;
   switch (Val->getType()->getTypeID()) {
   default: assert(0 && "Unknown FP type!");
   case Type::FloatTyID:  Name = "llvm.powi.f32"; FCache = &Fn32; break;
@@ -3389,7 +3382,8 @@
   // First time we used this intrinsic?
   if (*FCache == 0)
     *FCache = TheModule->getOrInsertFunction(Name, Val->getType(),
-                                             Val->getType(), Type::Int32Ty, NULL);
+                                             Val->getType(), Type::Int32Ty,
+                                             NULL);
   return new CallInst(*FCache, Val, Pow, "tmp", CurBB);
 }
 
@@ -3521,7 +3515,7 @@
   
   Ptr = CastToType(Instruction::BitCast, Ptr, PointerType::get(Type::Int8Ty));
   
-  static Function *llvm_prefetch_fn = 0;
+  static Constant *llvm_prefetch_fn = 0;
   if (!llvm_prefetch_fn)
     llvm_prefetch_fn = 
       TheModule->getOrInsertFunction("llvm.prefetch", Type::VoidTy,
@@ -3553,7 +3547,7 @@
   }
   
   Value *Fn;
-  static Function *llvm_retaddr = 0, *llvm_frameaddr;
+  static Constant *llvm_retaddr = 0, *llvm_frameaddr;
   if (!isFrame) {
     if (!llvm_retaddr)
       llvm_retaddr = 
@@ -3580,7 +3574,7 @@
   if (!validate_arglist(arglist, VOID_TYPE))
     return false;
   
-  static Function *Fn = 0;
+  static Constant *Fn = 0;
   if (!Fn)
     Fn = TheModule->getOrInsertFunction("llvm.stacksave",
                                        PointerType::get(Type::Int8Ty), NULL);
@@ -3593,7 +3587,7 @@
   if (!validate_arglist(arglist, POINTER_TYPE, VOID_TYPE))
     return false;
   
-  static Function *Fn = 0;
+  static Constant *Fn = 0;
   if (!Fn)
     Fn = TheModule->getOrInsertFunction("llvm.stackrestore", Type::VoidTy,
                                         PointerType::get(Type::Int8Ty), NULL);
@@ -3629,7 +3623,7 @@
   tree arglist = TREE_OPERAND(exp, 1);
   tree fntype = TREE_TYPE(current_function_decl);
   
-  static Function *llvm_va_start_fn = 0;
+  static Constant *llvm_va_start_fn = 0;
   if (!llvm_va_start_fn) {
     tree FnDecl = TREE_OPERAND(TREE_OPERAND(exp, 0), 0);
     const FunctionType *FnTy = 
@@ -3657,7 +3651,8 @@
   
   Value *ArgVal = Emit(TREE_VALUE(arglist), 0);
 
-  const Type *FTy = llvm_va_start_fn->getType()->getElementType();
+  const Type *FTy =
+    cast<PointerType>(llvm_va_start_fn->getType())->getElementType();
   ArgVal = CastToType(Instruction::BitCast, ArgVal, 
                       cast<FunctionType>(FTy)->getParamType(0));
   new CallInst(llvm_va_start_fn, ArgVal, "", CurBB);
@@ -3665,7 +3660,7 @@
 }
 
 bool TreeToLLVM::EmitBuiltinVAEnd(tree exp) {
-  static Function *llvm_va_end_fn = 0;
+  static Constant *llvm_va_end_fn = 0;
   if (!llvm_va_end_fn) {
     tree FnDecl = TREE_OPERAND(TREE_OPERAND(exp, 0), 0);
     const FunctionType *VAEndTy = 
@@ -3674,7 +3669,8 @@
   }
   
   Value *Arg = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0);
-  const Type *FTy = llvm_va_end_fn->getType()->getElementType();
+  const Type *FTy =
+    cast<PointerType>(llvm_va_end_fn->getType())->getElementType();
   Arg = CastToType(Instruction::BitCast, Arg, 
                    cast<FunctionType>(FTy)->getParamType(0));
 
@@ -3683,7 +3679,7 @@
 }
 
 bool TreeToLLVM::EmitBuiltinVACopy(tree exp) {
-  static Function *llvm_va_copy_fn = 0;
+  static Constant *llvm_va_copy_fn = 0;
   if (!llvm_va_copy_fn) {
     tree FnDecl = TREE_OPERAND(TREE_OPERAND(exp, 0), 0);
     const FunctionType *FnTy = 
@@ -3713,7 +3709,8 @@
     Emit(Arg2T, Arg2);
   }
   
-  const Type *FTy = llvm_va_copy_fn->getType()->getElementType();
+  const Type *FTy =
+    cast<PointerType>(llvm_va_copy_fn->getType())->getElementType();
   const Type *PtrList = cast<FunctionType>(FTy)->getParamType(0);
   Arg1 = CastToType(Instruction::BitCast, Arg1, PtrList);
   Arg2 = CastToType(Instruction::BitCast, Arg2, PtrList);
@@ -4410,6 +4407,11 @@
   const Type *Ty = ConvertType(TREE_TYPE(exp));
   bool EltIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0)));
   bool TyIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp));
+  
+  // If this is a structure-to-structure cast, just return the uncasted value.
+  if (!Elt->getType()->isFirstClassType() || !Ty->isFirstClassType())
+    return Elt;
+  
   // Elt and Ty can be integer, float or pointer here: need generalized cast
   Instruction::CastOps opcode = CastInst::getCastOpcode(Elt, EltIsSigned,
                                                         Ty, TyIsSigned);
Index: gcc/llvm-internal.h
===================================================================
--- gcc/llvm-internal.h	(revision 240)
+++ gcc/llvm-internal.h	(working copy)
@@ -32,6 +32,7 @@
 #include <cassert>
 #include <map>
 #include <string>
+#include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Streams.h"
 
@@ -469,6 +470,17 @@
   Value *EmitINTEGER_CST(tree_node *exp);
   Value *EmitREAL_CST(tree_node *exp);
   Value *EmitCONSTRUCTOR(tree_node *exp, Value *DestLoc);
+
+  // Optional target defined builtin intrinsic expanding function.
+  bool TargetIntrinsicLower(unsigned FnCode,
+                            Value *DestLoc,
+                            Value *&Result,
+                            const Type *ResultType,
+                            std::vector<Value*> &Ops,
+                            SmallVector<tree_node *, 8> &Args,
+                            BasicBlock *CurBB,
+                            bool ResIsSigned,
+                            bool ExpIsSigned);
 };
 
 /// TreeConstantToLLVM - An instance of this class is created and used to 
Index: gcc/llvm-debug.cpp
===================================================================
--- gcc/llvm-debug.cpp	(revision 240)
+++ gcc/llvm-debug.cpp	(working copy)
@@ -274,8 +274,10 @@
   
   // Lazily construct llvm.dbg.func.start.
   if (!FuncStartFn) {
-    FuncStartFn = M->getOrInsertFunction("llvm.dbg.func.start",
-      Type::VoidTy, SR.getEmptyStructPtrType(), NULL);  
+    FuncStartFn =
+      cast<Function>(M->getOrInsertFunction("llvm.dbg.func.start",
+                                            Type::VoidTy,
+                                            SR.getEmptyStructPtrType(), NULL));
   }
 
   // Call llvm.dbg.func.start.
@@ -298,8 +300,9 @@
   // Lazily construct llvm.dbg.region.start function.
   if (!RegionStartFn) {
     const PointerType *EmpPtr = SR.getEmptyStructPtrType();
-    RegionStartFn = M->getOrInsertFunction("llvm.dbg.region.start",
-      Type::VoidTy, EmpPtr, NULL);
+    RegionStartFn = 
+      cast<Function>(M->getOrInsertFunction("llvm.dbg.region.start",
+                                            Type::VoidTy, EmpPtr, NULL));
   }
   
   // Call llvm.dbg.func.start.
@@ -312,8 +315,9 @@
   // Lazily construct llvm.dbg.region.end function.
   if (!RegionEndFn) {
     const PointerType *EmpPtr = SR.getEmptyStructPtrType();
-    RegionEndFn = M->getOrInsertFunction("llvm.dbg.region.end",
-      Type::VoidTy, EmpPtr, NULL);
+    RegionEndFn =
+      cast<Function>(M->getOrInsertFunction("llvm.dbg.region.end", Type::VoidTy,
+                                            EmpPtr, NULL));
   }
   
   // Provide an region stop point.
@@ -331,8 +335,9 @@
   // Lazily construct llvm.dbg.declare function.
   const PointerType *EmpPtr = SR.getEmptyStructPtrType();
   if (!DeclareFn) {
-    DeclareFn = M->getOrInsertFunction("llvm.dbg.declare",
-      Type::VoidTy, EmpPtr, EmpPtr, NULL);
+    DeclareFn =
+      cast<Function>(M->getOrInsertFunction("llvm.dbg.declare",
+                                            Type::VoidTy, EmpPtr, EmpPtr,NULL));
   }
   
   // Get type information.
@@ -378,9 +383,11 @@
   
   // Lazily construct llvm.dbg.stoppoint function.
   if (!StopPointFn) {
-    StopPointFn = M->getOrInsertFunction("llvm.dbg.stoppoint",
-      Type::VoidTy, Type::Int32Ty, Type::Int32Ty,
-                    SR.getEmptyStructPtrType(), NULL);
+    StopPointFn =
+      cast<Function>(M->getOrInsertFunction("llvm.dbg.stoppoint",
+                                            Type::VoidTy, Type::Int32Ty,
+                                            Type::Int32Ty,
+                                            SR.getEmptyStructPtrType(), NULL));
   }
   
   // Invoke llvm.dbg.stoppoint
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 240)
+++ gcc/Makefile.in	(working copy)
@@ -429,7 +429,7 @@
 [EMAIL PROTECTED]@
 out_file=$(srcdir)/config/@out_file@
 # APPLE LOCAL LLVM
-out_cxx_file=$(srcdir)/config/@out_cxx_file@
[EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 # APPLE LOCAL LLVM
 [EMAIL PROTECTED]@
@@ -1023,8 +1023,12 @@
  lambda-trans.o	lambda-code.o tree-loop-linear.o
 # APPLE LOCAL end lno, loops-to-memset
 
-# APPLE LOCAL LLVM
-OBJS-md = $(out_object_file) $(out_cxx_object_file)
+OBJS-md = $(out_object_file)
+# APPLE LOCAL begin LLVM
+ifneq ($(out_cxx_file),)
+OBJC-md += $(out_cxx_object_file)
+endif
+# APPLE LOCAL end LLVM
 OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o		   \
   cgraph.o cgraphunit.o tree-nomudflap.o
 
@@ -1114,9 +1118,12 @@
 endif
 # APPLE LOCAL end LLVM
 
-# APPLE LOCAL LLVM
-OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive) $(out_cxx_object_file)
-
+OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive)
+# APPLE LOCAL begin LLVM
+ifneq ($(out_cxx_file),)
+OBJS += $(out_cxx_object_file)
+endif
+# APPLE LOCAL end LLVM
 OBJS-onestep = libbackend.o $(OBJS-archive)
 
 # APPLE LOCAL begin LLVM
@@ -2472,13 +2479,15 @@
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 		$(out_file) $(OUTPUT_OPTION)
 # APPLE LOCAL begin LLVM
-$(out_cxx_object_file): $(out_cxx_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \
+ifneq ($(out_cxx_file),)
+$(out_cxx_object_file): $(srcdir)/config/$(out_cxx_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \
    $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
    output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \
    $(TARGET_DEF_H) function.h $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) $(OPTABS_H) \
    langhooks.h
-	$(CXX) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-		$(out_cxx_file) $(OUTPUT_OPTION)
+	$(CXX) -c $(ALL_CXXFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+		$(srcdir)/config/$(out_cxx_file) $(OUTPUT_OPTION)
+endif
 # APPLE LOCAL end  LLVM
 
 # Build auxiliary files that support ecoff format.
Index: gcc/config/i386/i386.h
===================================================================
--- gcc/config/i386/i386.h	(revision 240)
+++ gcc/config/i386/i386.h	(working copy)
@@ -4101,7 +4101,7 @@
   case IX86_BUILTIN_PSLLWI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
     PackedType *v8i16 = PackedType::get(Type::Int16Ty, 8);                    \
-    static Function *psllw = 0;                                               \
+    static Constant *psllw = 0;                                               \
     if (psllw == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       psllw = M->getOrInsertFunction("llvm.x86.sse2.psll.w",                  \
@@ -4115,7 +4115,7 @@
   }                                                                           \
   case IX86_BUILTIN_PSLLDI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
-    static Function *pslld = 0;                                               \
+    static Constant *pslld = 0;                                               \
     if (pslld == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       pslld = M->getOrInsertFunction("llvm.x86.sse2.psll.d",                  \
@@ -4130,7 +4130,7 @@
   case IX86_BUILTIN_PSLLQI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
     PackedType *v2i64 = PackedType::get(Type::Int64Ty, 2);                     \
-    static Function *psllq = 0;                                               \
+    static Constant *psllq = 0;                                               \
     if (psllq == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       psllq = M->getOrInsertFunction("llvm.x86.sse2.psll.q",                  \
@@ -4145,7 +4145,7 @@
   case IX86_BUILTIN_PSRLWI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
     PackedType *v8i16 = PackedType::get(Type::Int16Ty, 8);                    \
-    static Function *psrlw = 0;                                               \
+    static Constant *psrlw = 0;                                               \
     if (psrlw == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       psrlw = M->getOrInsertFunction("llvm.x86.sse2.psrl.w",                  \
@@ -4159,7 +4159,7 @@
   }                                                                           \
   case IX86_BUILTIN_PSRLDI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
-    static Function *psrld = 0;                                               \
+    static Constant *psrld = 0;                                               \
     if (psrld == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       psrld = M->getOrInsertFunction("llvm.x86.sse2.psrl.d",                  \
@@ -4174,7 +4174,7 @@
   case IX86_BUILTIN_PSRLQI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
     PackedType *v2i64 = PackedType::get(Type::Int64Ty, 2);                     \
-    static Function *psrlq = 0;                                               \
+    static Constant *psrlq = 0;                                               \
     if (psrlq == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       psrlq = M->getOrInsertFunction("llvm.x86.sse2.psrl.q",                  \
@@ -4189,7 +4189,7 @@
   case IX86_BUILTIN_PSRAWI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
     PackedType *v8i16 = PackedType::get(Type::Int16Ty, 8);                    \
-    static Function *psraw = 0;                                               \
+    static Constant *psraw = 0;                                               \
     if (psraw == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       psraw = M->getOrInsertFunction("llvm.x86.sse2.psra.w",                  \
@@ -4203,7 +4203,7 @@
   }                                                                           \
   case IX86_BUILTIN_PSRADI128: {                                              \
     PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4);                      \
-    static Function *psrad = 0;                                               \
+    static Constant *psrad = 0;                                               \
     if (psrad == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       psrad = M->getOrInsertFunction("llvm.x86.sse2.psra.d",                  \
@@ -4453,7 +4453,7 @@
   case IX86_BUILTIN_CMPORDPS:                                                 \
   case IX86_BUILTIN_CMPUNORDPS: {                                             \
     PackedType *v4f32 = PackedType::get(Type::FloatTy, 4);                    \
-    static Function *cmpps = 0;                                               \
+    static Constant *cmpps = 0;                                               \
     if (cmpps == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       cmpps = M->getOrInsertFunction("llvm.x86.sse.cmp.ps",                   \
@@ -4527,7 +4527,7 @@
   case IX86_BUILTIN_CMPORDSS:                                                 \
   case IX86_BUILTIN_CMPUNORDSS: {                                             \
     PackedType *v4f32 = PackedType::get(Type::FloatTy, 4);                    \
-    static Function *cmpss = 0;                                               \
+    static Constant *cmpss = 0;                                               \
     if (cmpss == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       cmpss = M->getOrInsertFunction("llvm.x86.sse.cmp.ss",                   \
@@ -4581,7 +4581,7 @@
   case IX86_BUILTIN_CMPORDPD:                                                 \
   case IX86_BUILTIN_CMPUNORDPD: {                                             \
     PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2);                   \
-    static Function *cmpps = 0;                                               \
+    static Constant *cmpps = 0;                                               \
     if (cmpps == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       cmpps = M->getOrInsertFunction("llvm.x86.sse2.cmp.pd",                  \
@@ -4653,7 +4653,7 @@
   case IX86_BUILTIN_CMPORDSD:                                                 \
   case IX86_BUILTIN_CMPUNORDSD: {                                             \
     PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2);                   \
-    static Function *cmpss = 0;                                               \
+    static Constant *cmpss = 0;                                               \
     if (cmpss == 0) {                                                         \
       Module *M = CURBB->getParent()->getParent();                            \
       cmpss = M->getOrInsertFunction("llvm.x86.sse2.cmp.sd",                  \
@@ -4696,7 +4696,7 @@
   }                                                                           \
   case IX86_BUILTIN_LDMXCSR: {                                                \
     PointerType *u32Ptr = PointerType::get(Type::Int32Ty);                     \
-    static Function *ldmxcsr = 0;                                             \
+    static Constant *ldmxcsr = 0;                                             \
     if (ldmxcsr == 0) {                                                       \
       Module *M = CURBB->getParent()->getParent();                            \
       ldmxcsr = M->getOrInsertFunction("llvm.x86.sse.ldmxcsr",                \
@@ -4709,7 +4709,7 @@
   }                                                                           \
   case IX86_BUILTIN_STMXCSR: {                                                \
     PointerType *u32Ptr = PointerType::get(Type::Int32Ty);                     \
-    static Function *stmxcsr = 0;                                             \
+    static Constant *stmxcsr = 0;                                             \
     if (stmxcsr == 0) {                                                       \
       Module *M = CURBB->getParent()->getParent();                            \
       stmxcsr = M->getOrInsertFunction("llvm.x86.sse.stmxcsr",                \
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to