[llvm-commits] [llvm-gcc-4.2] r77515 - in /llvm-gcc-4.2/trunk/gcc: config/arm/llvm-arm.cpp config/i386/llvm-i386.cpp config/rs6000/llvm-rs6000.cpp llvm-backend.cpp llvm-convert.cpp llvm-types.cpp

Owen Anderson resistor at mac.com
Wed Jul 29 15:17:05 PDT 2009


Author: resistor
Date: Wed Jul 29 17:17:04 2009
New Revision: 77515

URL: http://llvm.org/viewvc/llvm-project?rev=77515&view=rev
Log:
Update for LLVM API change.

Modified:
    llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
    llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
    llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp
    llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
    llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=77515&r1=77514&r2=77515&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Wed Jul 29 17:17:04 2009
@@ -213,7 +213,7 @@
 
   // Right shifts are represented in NEON intrinsics by a negative shift count.
   LLVMContext &Context = getGlobalContext();
-  Cnt = ConstantInt::get(Context.getIntegerType(ElemBits),
+  Cnt = ConstantInt::get(IntegerType::get(ElemBits),
                                NegateRightShift ? -CntVal : CntVal);
   Op = BuildConstantSplatVector(GET_MODE_NUNITS(Mode), Cnt);
   return true;
@@ -1881,7 +1881,7 @@
   case NEON_BUILTIN_vtbl3:
   case NEON_BUILTIN_vtbl4: {
     unsigned NUnits = Ops[0]->getType()->getPrimitiveSizeInBits() / 8;
-    intOpTypes[0] = Context.getVectorType(Context.getIntegerType(8), NUnits);
+    intOpTypes[0] = VectorType::get(IntegerType::get(8), NUnits);
     intID = Intrinsic::arm_neon_vtbl;
     intFn = Intrinsic::getDeclaration(TheModule, intID, intOpTypes, 1);
     Result = Builder.CreateCall2(intFn, Ops[0], Ops[1]);
@@ -1893,7 +1893,7 @@
   case NEON_BUILTIN_vtbx3:
   case NEON_BUILTIN_vtbx4: {
     unsigned NUnits = Ops[1]->getType()->getPrimitiveSizeInBits() / 8;
-    intOpTypes[0] = Context.getVectorType(Context.getIntegerType(8), NUnits);
+    intOpTypes[0] = VectorType::get(IntegerType::get(8), NUnits);
     intID = Intrinsic::arm_neon_vtbx;
     intFn = Intrinsic::getDeclaration(TheModule, intID, intOpTypes, 1);
     Result = Builder.CreateCall3(intFn, Ops[0], Ops[1], Ops[2]);
@@ -1972,7 +1972,7 @@
     else
       intID = Intrinsic::arm_neon_vld1i;
     intFn = Intrinsic::getDeclaration(TheModule, intID, (const Type **)&VTy, 1);
-    Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
+    Type *VPTy = PointerType::getUnqual(Type::Int8Ty);
     Result = Builder.CreateCall(intFn, BitCastToType(Ops[0], VPTy));
     break;
   }
@@ -2000,7 +2000,7 @@
       }
     }
     intFn = Intrinsic::getDeclaration(TheModule, intID, (const Type **)&VTy, 1);
-    Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
+    Type *VPTy = PointerType::getUnqual(Type::Int8Ty);
     Result = Builder.CreateCall(intFn, BitCastToType(Ops[0], VPTy));
     Builder.CreateStore(Result, DestLoc->Ptr);
     Result = 0;
@@ -2033,7 +2033,7 @@
                                           LaneVal + (n * NUnits));
       Result = Builder.CreateInsertElement(Result, Elt, Ndx);
     }
-    Type *PtrToWideVec = Context.getPointerTypeUnqual(VTy);
+    Type *PtrToWideVec = PointerType::getUnqual(VTy);
     Builder.CreateStore(Result, BitCastToType(DestLoc->Ptr, PtrToWideVec));
     Result = 0;
     break;
@@ -2073,7 +2073,7 @@
       Result = Builder.CreateShuffleVector(Result, Context.getUndef(VTy),
                                            ConstantVector::get(Idxs));
     }
-    Type *PtrToWideVec = Context.getPointerTypeUnqual(VTy);
+    Type *PtrToWideVec = PointerType::getUnqual(VTy);
     Builder.CreateStore(Result, BitCastToType(DestLoc->Ptr, PtrToWideVec));
     Result = 0;
     break;
@@ -2087,7 +2087,7 @@
     else
       intID = Intrinsic::arm_neon_vst1i;
     intFn = Intrinsic::getDeclaration(TheModule, intID, (const Type **)&VTy, 1);
-    Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
+    Type *VPTy = PointerType::getUnqual(Type::Int8Ty);
     Builder.CreateCall2(intFn, BitCastToType(Ops[0], VPTy), Ops[1]);
     Result = 0;
     break;
@@ -2124,7 +2124,7 @@
     default: assert(false);
     }
     std::vector<Value*> Args;
-    Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
+    Type *VPTy = PointerType::getUnqual(Type::Int8Ty);
     Args.push_back(BitCastToType(Ops[0], VPTy));
     for (unsigned n = 0; n < NumVecs; ++n) {
       Args.push_back(Builder.CreateExtractValue(Ops[1], n));
@@ -2152,7 +2152,7 @@
     if (!isValidLane(Ops[2], NUnits, &LaneVal))
       return UnexpectedError("%Hinvalid lane number", exp, Result);
     Value *Tmp = CreateTemporary(VTy);
-    Type *PtrToStruct = Context.getPointerTypeUnqual(Ops[1]->getType());
+    Type *PtrToStruct = PointerType::getUnqual(Ops[1]->getType());
     Builder.CreateStore(Ops[1], BitCastToType(Tmp, PtrToStruct));
     Value *Vec = Builder.CreateLoad(Tmp);
     for (unsigned n = 0; n != NumVecs; ++n) {

Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=77515&r1=77514&r2=77515&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Wed Jul 29 17:17:04 2009
@@ -113,11 +113,11 @@
   case IX86_BUILTIN_ANDNPD:
     if (cast<VectorType>(ResultType)->getNumElements() == 4)  // v4f32
       Ops[0] = Builder.CreateBitCast(Ops[0], 
-                                     Context.getVectorType(Type::Int32Ty, 4),
+                                     VectorType::get(Type::Int32Ty, 4),
                                      "tmp");
     else                                                      // v2f64
       Ops[0] = Builder.CreateBitCast(Ops[0], 
-                                     Context.getVectorType(Type::Int64Ty, 2),
+                                     VectorType::get(Type::Int64Ty, 2),
                                      "tmp");
     
     Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "tmp");
@@ -279,7 +279,7 @@
     return true;
   }
   case IX86_BUILTIN_LOADQ: {
-    PointerType *i64Ptr = Context.getPointerTypeUnqual(Type::Int64Ty);
+    PointerType *i64Ptr = PointerType::getUnqual(Type::Int64Ty);
     Ops[0] = Builder.CreateBitCast(Ops[0], i64Ptr, "tmp");
     Ops[0] = Builder.CreateLoad(Ops[0], "tmp");
     Value *Zero = ConstantInt::get(Type::Int64Ty, 0);
@@ -290,8 +290,8 @@
     return true;
   }
   case IX86_BUILTIN_LOADUPS: {
-    VectorType *v4f32 = Context.getVectorType(Type::FloatTy, 4);
-    PointerType *v4f32Ptr = Context.getPointerTypeUnqual(v4f32);
+    VectorType *v4f32 = VectorType::get(Type::FloatTy, 4);
+    PointerType *v4f32Ptr = PointerType::getUnqual(v4f32);
     Value *BC = Builder.CreateBitCast(Ops[0], v4f32Ptr, "tmp");
     LoadInst *LI = Builder.CreateLoad(BC, "tmp");
     LI->setAlignment(1);
@@ -299,8 +299,8 @@
     return true;
   }
   case IX86_BUILTIN_LOADUPD: {
-    VectorType *v2f64 = Context.getVectorType(Type::DoubleTy, 2);
-    PointerType *v2f64Ptr = Context.getPointerTypeUnqual(v2f64);
+    VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2);
+    PointerType *v2f64Ptr = PointerType::getUnqual(v2f64);
     Value *BC = Builder.CreateBitCast(Ops[0], v2f64Ptr, "tmp");
     LoadInst *LI = Builder.CreateLoad(BC, "tmp");
     LI->setAlignment(1);
@@ -308,8 +308,8 @@
     return true;
   }
   case IX86_BUILTIN_LOADDQU: {
-    VectorType *v16i8 = Context.getVectorType(Type::Int8Ty, 16);
-    PointerType *v16i8Ptr = Context.getPointerTypeUnqual(v16i8);
+    VectorType *v16i8 = VectorType::get(Type::Int8Ty, 16);
+    PointerType *v16i8Ptr = PointerType::getUnqual(v16i8);
     Value *BC = Builder.CreateBitCast(Ops[0], v16i8Ptr, "tmp");
     LoadInst *LI = Builder.CreateLoad(BC, "tmp");
     LI->setAlignment(1);
@@ -317,8 +317,8 @@
     return true;
   }
   case IX86_BUILTIN_STOREUPS: {
-    VectorType *v4f32 = Context.getVectorType(Type::FloatTy, 4);
-    PointerType *v4f32Ptr = Context.getPointerTypeUnqual(v4f32);
+    VectorType *v4f32 = VectorType::get(Type::FloatTy, 4);
+    PointerType *v4f32Ptr = PointerType::getUnqual(v4f32);
     Value *BC = Builder.CreateBitCast(Ops[0], v4f32Ptr, "tmp");
     StoreInst *SI = Builder.CreateStore(Ops[1], BC);
     SI->setAlignment(1);
@@ -326,8 +326,8 @@
     return true;
   }
   case IX86_BUILTIN_STOREUPD: {
-    VectorType *v2f64 = Context.getVectorType(Type::DoubleTy, 2);
-    PointerType *v2f64Ptr = Context.getPointerTypeUnqual(v2f64);
+    VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2);
+    PointerType *v2f64Ptr = PointerType::getUnqual(v2f64);
     Value *BC = Builder.CreateBitCast(Ops[0], v2f64Ptr, "tmp");
     StoreInst *SI = Builder.CreateStore(Ops[1], BC);
     SI->setAlignment(1);
@@ -335,8 +335,8 @@
     return true;
   }
   case IX86_BUILTIN_STOREDQU: {
-    VectorType *v16i8 = Context.getVectorType(Type::Int8Ty, 16);
-    PointerType *v16i8Ptr = Context.getPointerTypeUnqual(v16i8);
+    VectorType *v16i8 = VectorType::get(Type::Int8Ty, 16);
+    PointerType *v16i8Ptr = PointerType::getUnqual(v16i8);
     Value *BC = Builder.CreateBitCast(Ops[0], v16i8Ptr, "tmp");
     StoreInst *SI = Builder.CreateStore(Ops[1], BC);
     SI->setAlignment(1);
@@ -344,7 +344,7 @@
     return true;
   }
   case IX86_BUILTIN_LOADHPS: {
-    PointerType *f64Ptr = Context.getPointerTypeUnqual(Type::DoubleTy);
+    PointerType *f64Ptr = PointerType::getUnqual(Type::DoubleTy);
     Ops[1] = Builder.CreateBitCast(Ops[1], f64Ptr, "tmp");
     Value *Load = Builder.CreateLoad(Ops[1], "tmp");
     Ops[1] = BuildVector(Load, Context.getUndef(Type::DoubleTy), NULL);
@@ -354,7 +354,7 @@
     return true;
   }
   case IX86_BUILTIN_LOADLPS: {
-    PointerType *f64Ptr = Context.getPointerTypeUnqual(Type::DoubleTy);
+    PointerType *f64Ptr = PointerType::getUnqual(Type::DoubleTy);
     Ops[1] = Builder.CreateBitCast(Ops[1], f64Ptr, "tmp");
     Value *Load = Builder.CreateLoad(Ops[1], "tmp");
     Ops[1] = BuildVector(Load, Context.getUndef(Type::DoubleTy), NULL);
@@ -380,8 +380,8 @@
     return true;
   }
   case IX86_BUILTIN_STOREHPS: {
-    VectorType *v2f64 = Context.getVectorType(Type::DoubleTy, 2);
-    PointerType *f64Ptr = Context.getPointerTypeUnqual(Type::DoubleTy);
+    VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2);
+    PointerType *f64Ptr = PointerType::getUnqual(Type::DoubleTy);
     Ops[0] = Builder.CreateBitCast(Ops[0], f64Ptr, "tmp");
     Value *Idx = ConstantInt::get(Type::Int32Ty, 1);
     Ops[1] = Builder.CreateBitCast(Ops[1], v2f64, "tmp");
@@ -390,8 +390,8 @@
     return true;
   }
   case IX86_BUILTIN_STORELPS: {
-    VectorType *v2f64 = Context.getVectorType(Type::DoubleTy, 2);
-    PointerType *f64Ptr = Context.getPointerTypeUnqual(Type::DoubleTy);
+    VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2);
+    PointerType *f64Ptr = PointerType::getUnqual(Type::DoubleTy);
     Ops[0] = Builder.CreateBitCast(Ops[0], f64Ptr, "tmp");
     Value *Idx = ConstantInt::get(Type::Int32Ty, 0);
     Ops[1] = Builder.CreateBitCast(Ops[1], v2f64, "tmp");
@@ -593,7 +593,7 @@
     Value *Ptr = CreateTemporary(Type::Int32Ty);
     Builder.CreateStore(Ops[0], Ptr);
     Ptr = Builder.CreateBitCast(Ptr,
-                             Context.getPointerTypeUnqual(Type::Int8Ty), "tmp");
+                             PointerType::getUnqual(Type::Int8Ty), "tmp");
     Result = Builder.CreateCall(ldmxcsr, Ptr);
     return true;
   }
@@ -602,7 +602,7 @@
       Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse_stmxcsr);
     Value *Ptr  = CreateTemporary(Type::Int32Ty);
     Value *BPtr = Builder.CreateBitCast(Ptr,
-                             Context.getPointerTypeUnqual(Type::Int8Ty), "tmp");
+                             PointerType::getUnqual(Type::Int8Ty), "tmp");
     Builder.CreateCall(stmxcsr, BPtr);
     
     Result = Builder.CreateLoad(Ptr, "tmp");
@@ -868,25 +868,25 @@
           if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
             if (VTy->getNumElements() == 2) {
               if (VTy->getElementType()->isInteger()) {
-                Elts.push_back(Context.getVectorType(Type::Int64Ty, 2));
+                Elts.push_back(VectorType::get(Type::Int64Ty, 2));
               } else {
-                Elts.push_back(Context.getVectorType(Type::DoubleTy, 2));
+                Elts.push_back(VectorType::get(Type::DoubleTy, 2));
               }
               Bytes -= 8;
             } else {
               assert(VTy->getNumElements() == 4);
               if (VTy->getElementType()->isInteger()) {
-                Elts.push_back(Context.getVectorType(Type::Int32Ty, 4));
+                Elts.push_back(VectorType::get(Type::Int32Ty, 4));
               } else {
-                Elts.push_back(Context.getVectorType(Type::FloatTy, 4));
+                Elts.push_back(VectorType::get(Type::FloatTy, 4));
               }
               Bytes -= 4;
             }
           } else if (llvm_x86_is_all_integer_types(Ty)) {
-            Elts.push_back(Context.getVectorType(Type::Int32Ty, 4));
+            Elts.push_back(VectorType::get(Type::Int32Ty, 4));
             Bytes -= 4;
           } else {
-            Elts.push_back(Context.getVectorType(Type::FloatTy, 4));
+            Elts.push_back(VectorType::get(Type::FloatTy, 4));
             Bytes -= 4;
           }
         } else if (Class[i+1] == X86_64_SSESF_CLASS) {
@@ -899,10 +899,10 @@
           Elts.push_back(Type::DoubleTy);
           Bytes -= 16;
         } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == 16) {
-          Elts.push_back(Context.getVectorType(Type::FloatTy, 2));
+          Elts.push_back(VectorType::get(Type::FloatTy, 2));
           Elts.push_back(Type::DoubleTy);
         } else if (Class[i+1] == X86_64_INTEGER_CLASS) {
-          Elts.push_back(Context.getVectorType(Type::FloatTy, 2));
+          Elts.push_back(VectorType::get(Type::FloatTy, 2));
           Elts.push_back(Type::Int64Ty);
         } else if (Class[i+1] == X86_64_NO_CLASS) {
           // padding bytes, don't pass
@@ -1161,9 +1161,9 @@
     if (Size <= 8)
       return Type::Int64Ty;
     else if (Size <= 16)
-      return Context.getIntegerType(128);
+      return IntegerType::get(128);
     else if (Size <= 32)
-      return Context.getIntegerType(256);
+      return IntegerType::get(256);
   }
   return NULL;
 }
@@ -1232,23 +1232,23 @@
           if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
             if (VTy->getNumElements() == 2) {
               if (VTy->getElementType()->isInteger())
-                Elts.push_back(Context.getVectorType(Type::Int64Ty, 2));
+                Elts.push_back(VectorType::get(Type::Int64Ty, 2));
               else
-                Elts.push_back(Context.getVectorType(Type::DoubleTy, 2));
+                Elts.push_back(VectorType::get(Type::DoubleTy, 2));
               Bytes -= 8;
             } else {
               assert(VTy->getNumElements() == 4);
               if (VTy->getElementType()->isInteger())
-                Elts.push_back(Context.getVectorType(Type::Int32Ty, 4));
+                Elts.push_back(VectorType::get(Type::Int32Ty, 4));
               else
-                Elts.push_back(Context.getVectorType(Type::FloatTy, 4));
+                Elts.push_back(VectorType::get(Type::FloatTy, 4));
               Bytes -= 4;
             }
           } else if (llvm_x86_is_all_integer_types(Ty)) {
-            Elts.push_back(Context.getVectorType(Type::Int32Ty, 4));
+            Elts.push_back(VectorType::get(Type::Int32Ty, 4));
             Bytes -= 4;
           } else {
-            Elts.push_back(Context.getVectorType(Type::FloatTy, 4));
+            Elts.push_back(VectorType::get(Type::FloatTy, 4));
             Bytes -= 4;
           }
         } else if (Class[i+1] == X86_64_SSESF_CLASS) {
@@ -1261,10 +1261,10 @@
           Elts.push_back(Type::DoubleTy);
           Bytes -= 16;
         } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == 16) {
-          Elts.push_back(Context.getVectorType(Type::FloatTy, 2));
+          Elts.push_back(VectorType::get(Type::FloatTy, 2));
           Elts.push_back(Type::DoubleTy);
         } else if (Class[i+1] == X86_64_INTEGER_CLASS) {
-          Elts.push_back(Context.getVectorType(Type::FloatTy, 2));
+          Elts.push_back(VectorType::get(Type::FloatTy, 2));
           Elts.push_back(Type::Int64Ty);
         } else if (Class[i+1] == X86_64_NO_CLASS) {
           Elts.push_back(Type::DoubleTy);
@@ -1313,12 +1313,12 @@
   if (llvm_x86_should_not_return_complex_in_memory(type)) {
     ElementTypes.push_back(Type::X86_FP80Ty);
     ElementTypes.push_back(Type::X86_FP80Ty);
-    return Context.getStructType(ElementTypes, STy->isPacked());
+    return StructType::get(ElementTypes, STy->isPacked());
   } 
 
   std::vector<const Type*> GCCElts;
   llvm_x86_64_get_multiple_return_reg_classes(type, Ty, GCCElts);
-  return Context.getStructType(GCCElts, false);
+  return StructType::get(GCCElts, false);
 }
 
 // llvm_x86_extract_mrv_array_element - Helper function that help extract 

Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp?rev=77515&r1=77514&r2=77515&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp Wed Jul 29 17:17:04 2009
@@ -56,7 +56,7 @@
                                const Type *ResultType,
                                std::vector<Value*> &Ops,
                                LLVMBuilder &Builder, Value *&Result) {
-  const Type *VoidPtrTy = Context.getPointerTypeUnqual(Type::Int8Ty);
+  const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
   
   Function *IntFn = Intrinsic::getDeclaration(TheModule, IID);
   
@@ -182,7 +182,7 @@
                            Elt, Elt, Elt, Elt,  Elt, Elt, Elt, Elt, NULL);
     } else {
       error("%Helement must be an immediate", &EXPR_LOCATION(exp));
-      Result = Context.getUndef(Context.getVectorType(Type::Int8Ty, 16));
+      Result = Context.getUndef(VectorType::get(Type::Int8Ty, 16));
     }
     return true;
   case ALTIVEC_BUILTIN_VSPLTISH:
@@ -191,7 +191,7 @@
       Result = BuildVector(Elt, Elt, Elt, Elt,  Elt, Elt, Elt, Elt, NULL);
     } else {
       error("%Helement must be an immediate", &EXPR_LOCATION(exp));
-      Result = Context.getUndef(Context.getVectorType(Type::Int16Ty, 8));
+      Result = Context.getUndef(VectorType::get(Type::Int16Ty, 8));
     }
     return true;
   case ALTIVEC_BUILTIN_VSPLTISW:
@@ -200,7 +200,7 @@
       Result = BuildVector(Elt, Elt, Elt, Elt, NULL);
     } else {
       error("%Hmask must be an immediate", &EXPR_LOCATION(exp));
-      Result = Context.getUndef(Context.getVectorType(Type::Int32Ty, 4));
+      Result = Context.getUndef(VectorType::get(Type::Int32Ty, 4));
     }
     return true;
   case ALTIVEC_BUILTIN_VSPLTB:
@@ -248,7 +248,7 @@
     if (ConstantInt *Elt = dyn_cast<ConstantInt>(Ops[2])) {
       /* Map all of these to a shuffle. */
       unsigned Amt = Elt->getZExtValue() & 15;
-      VectorType *v16i8 = Context.getVectorType(Type::Int8Ty, 16);
+      VectorType *v16i8 = VectorType::get(Type::Int8Ty, 16);
       Ops[0] = Builder.CreateBitCast(Ops[0], v16i8, "tmp");
       Ops[1] = Builder.CreateBitCast(Ops[1], v16i8, "tmp");
       Result = BuildVectorShuffle(Ops[0], Ops[1],
@@ -298,7 +298,7 @@
     return true;
   case ALTIVEC_BUILTIN_ABS_V4SF: {
     // and out sign bits
-    VectorType *v4i32 = Context.getVectorType(Type::Int32Ty, 4);
+    VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4);
     Ops[0] = Builder.CreateBitCast(Ops[0], v4i32, "tmp");
     Constant *C = ConstantInt::get(Type::Int32Ty, 0x7FFFFFFF);
     C = ConstantVector::get(std::vector<Constant*>(4, C));
@@ -356,7 +356,7 @@
   case ALTIVEC_BUILTIN_VPERM_8HI:
   case ALTIVEC_BUILTIN_VPERM_16QI: {
     // Operation is identical on all types; we have a single intrinsic.
-    const Type *VecTy = Context.getVectorType(Type::Int32Ty, 4);
+    const Type *VecTy = VectorType::get(Type::Int32Ty, 4);
     Value *Op0 = CastToType(Instruction::BitCast, Ops[0], VecTy);
     Value *Op1 = CastToType(Instruction::BitCast, Ops[1], VecTy);
     Value *ActualOps[] = { Op0, Op1, Ops[2]};
@@ -371,7 +371,7 @@
   case ALTIVEC_BUILTIN_VSEL_8HI:
   case ALTIVEC_BUILTIN_VSEL_16QI: {
     // Operation is identical on all types; we have a single intrinsic.
-    const Type *VecTy = Context.getVectorType(Type::Int32Ty, 4);
+    const Type *VecTy = VectorType::get(Type::Int32Ty, 4);
     Value *Op0 = CastToType(Instruction::BitCast, Ops[0], VecTy);
     Value *Op1 = CastToType(Instruction::BitCast, Ops[1], VecTy);
     Value *Op2 = CastToType(Instruction::BitCast, Ops[2], VecTy);

Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=77515&r1=77514&r2=77515&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Wed Jul 29 17:17:04 2009
@@ -802,8 +802,8 @@
   LLVMContext &Context = getGlobalContext();
   
   const Type *FPTy =
-    Context.getFunctionType(Type::VoidTy, std::vector<const Type*>(), false);
-  FPTy = Context.getPointerTypeUnqual(FPTy);
+    FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
+  FPTy = PointerType::getUnqual(FPTy);
   
   for (unsigned i = 0, e = Tors.size(); i != e; ++i) {
     StructInit[0] = ConstantInt::get(Type::Int32Ty, Tors[i].second);
@@ -814,7 +814,7 @@
     InitList.push_back(ConstantStruct::get(StructInit, false));
   }
   Constant *Array = ConstantArray::get(
-    Context.getArrayType(InitList[0]->getType(), InitList.size()), InitList);
+    ArrayType::get(InitList[0]->getType(), InitList.size()), InitList);
   new GlobalVariable(*TheModule, Array->getType(), false,
                      GlobalValue::AppendingLinkage,
                      Array, Name);
@@ -842,14 +842,14 @@
 
   if (!AttributeUsedGlobals.empty()) {
     std::vector<Constant *> AUGs;
-    const Type *SBP= Context.getPointerTypeUnqual(Type::Int8Ty);
+    const Type *SBP= PointerType::getUnqual(Type::Int8Ty);
     for (SmallSetVector<Constant *,32>::iterator AI = AttributeUsedGlobals.begin(),
            AE = AttributeUsedGlobals.end(); AI != AE; ++AI) {
       Constant *C = *AI;
       AUGs.push_back(TheFolder->CreateBitCast(C, SBP));
     }
 
-    ArrayType *AT = Context.getArrayType(SBP, AUGs.size());
+    ArrayType *AT = ArrayType::get(SBP, AUGs.size());
     Constant *Init = ConstantArray::get(AT, AUGs);
     GlobalValue *gv = new GlobalVariable(*TheModule, AT, false,
                                          GlobalValue::AppendingLinkage, Init,
@@ -861,7 +861,7 @@
   // Add llvm.global.annotations
   if (!AttributeAnnotateGlobals.empty()) {
     Constant *Array = ConstantArray::get(
-      Context.getArrayType(AttributeAnnotateGlobals[0]->getType(),
+      ArrayType::get(AttributeAnnotateGlobals[0]->getType(),
                                       AttributeAnnotateGlobals.size()),
                        AttributeAnnotateGlobals);
     GlobalValue *gv = new GlobalVariable(*TheModule, Array->getType(), false,
@@ -1123,7 +1123,7 @@
   // Get file and line number
   Constant *lineNo = ConstantInt::get(Type::Int32Ty, DECL_SOURCE_LINE(decl));
   Constant *file = ConvertMetadataStringToGV(DECL_SOURCE_FILE(decl));
-  const Type *SBP= Context.getPointerTypeUnqual(Type::Int8Ty);
+  const Type *SBP= PointerType::getUnqual(Type::Int8Ty);
   file = TheFolder->CreateBitCast(file, SBP);
  
   // There may be multiple annotate attributes. Pass return of lookup_attr 
@@ -1585,7 +1585,7 @@
 
     // If we have "extern void foo", make the global have type {} instead of
     // type void.
-    if (Ty == Type::VoidTy) Ty = Context.getStructType(NULL, NULL);
+    if (Ty == Type::VoidTy) Ty = StructType::get(NULL, NULL);
 
     if (Name[0] == 0) {   // Global has no name.
       GV = new GlobalVariable(*TheModule, Ty, false, 

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=77515&r1=77514&r2=77515&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Jul 29 17:17:04 2009
@@ -219,7 +219,7 @@
     assert(!BYTES_BIG_ENDIAN && "Unsupported case - please report");
     // Do byte wise store because actual argument type does not match LLVMTy.
     assert(isa<IntegerType>(ArgVal->getType()) && "Expected an integer value!");
-    const Type *StoreType = Context.getIntegerType(RealSize * 8);
+    const Type *StoreType = IntegerType::get(RealSize * 8);
     Loc = Builder.CreateBitCast(Loc, StoreType->getPointerTo());
     if (ArgVal->getType()->getPrimitiveSizeInBits() >=
         StoreType->getPrimitiveSizeInBits())
@@ -229,7 +229,7 @@
     Builder.CreateStore(ArgVal, Loc);
   } else {
     // This cast only involves pointers, therefore BitCast.
-    Loc = Builder.CreateBitCast(Loc, Context.getPointerTypeUnqual(LLVMTy));
+    Loc = Builder.CreateBitCast(Loc, PointerType::getUnqual(LLVMTy));
     Builder.CreateStore(ArgVal, Loc);
   }
 }
@@ -369,7 +369,7 @@
       
       Value *Loc = LocStack.back();
       // This cast only involves pointers, therefore BitCast.
-      Loc = Builder.CreateBitCast(Loc, Context.getPointerTypeUnqual(StructTy));
+      Loc = Builder.CreateBitCast(Loc, PointerType::getUnqual(StructTy));
 
       Loc = Builder.CreateStructGEP(Loc, FieldNo);
       LocStack.push_back(Loc);    
@@ -652,7 +652,7 @@
     } else {
       Value *RetVal = DECL_LLVM(DECL_RESULT(FnDecl));
       if (const StructType *STy = dyn_cast<StructType>(Fn->getReturnType())) {
-        Value *R1 = BitCastToType(RetVal, Context.getPointerTypeUnqual(STy));
+        Value *R1 = BitCastToType(RetVal, PointerType::getUnqual(STy));
 
         llvm::Value *Idxs[2];
         Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0);
@@ -670,12 +670,12 @@
         // beginning of the aggregate (x86-64).
         if (ReturnOffset) {
           RetVal = BitCastToType(RetVal, 
-                                 Context.getPointerTypeUnqual(Type::Int8Ty));
+                                 PointerType::getUnqual(Type::Int8Ty));
           RetVal = Builder.CreateGEP(RetVal,
                       ConstantInt::get(TD.getIntPtrType(), ReturnOffset));
         }
         RetVal = BitCastToType(RetVal,
-                        Context.getPointerTypeUnqual(Fn->getReturnType()));
+                        PointerType::getUnqual(Fn->getReturnType()));
         RetVal = Builder.CreateLoad(RetVal, "retval");
         RetVals.push_back(RetVal);
       }
@@ -1304,9 +1304,9 @@
         // Don't copy tons of tiny elements.
         CountAggregateElements(LLVMTy) <= 8) {
       DestLoc.Ptr = BitCastToType(DestLoc.Ptr, 
-                                  Context.getPointerTypeUnqual(LLVMTy));
+                                  PointerType::getUnqual(LLVMTy));
       SrcLoc.Ptr = BitCastToType(SrcLoc.Ptr, 
-                                 Context.getPointerTypeUnqual(LLVMTy));
+                                 PointerType::getUnqual(LLVMTy));
       CopyAggregate(DestLoc, SrcLoc, Builder, type);
       return;
     }
@@ -1359,7 +1359,7 @@
         // Don't zero tons of tiny elements.
         CountAggregateElements(LLVMTy) <= 8) {
       DestLoc.Ptr = BitCastToType(DestLoc.Ptr, 
-                                  Context.getPointerTypeUnqual(LLVMTy));
+                                  PointerType::getUnqual(LLVMTy));
       ZeroAggregate(DestLoc, Builder);
       return;
     }
@@ -1371,7 +1371,7 @@
 
 Value *TreeToLLVM::EmitMemCpy(Value *DestPtr, Value *SrcPtr, Value *Size,
                               unsigned Align) {
-  const Type *SBP = Context.getPointerTypeUnqual(Type::Int8Ty);
+  const Type *SBP = PointerType::getUnqual(Type::Int8Ty);
   const Type *IntPtr = TD.getIntPtrType();
   Value *Ops[4] = {
     BitCastToType(DestPtr, SBP),
@@ -1387,7 +1387,7 @@
 
 Value *TreeToLLVM::EmitMemMove(Value *DestPtr, Value *SrcPtr, Value *Size,
                                unsigned Align) {
-  const Type *SBP = Context.getPointerTypeUnqual(Type::Int8Ty);
+  const Type *SBP = PointerType::getUnqual(Type::Int8Ty);
   const Type *IntPtr = TD.getIntPtrType();
   Value *Ops[4] = {
     BitCastToType(DestPtr, SBP),
@@ -1403,7 +1403,7 @@
 
 Value *TreeToLLVM::EmitMemSet(Value *DestPtr, Value *SrcVal, Value *Size,
                               unsigned Align) {
-  const Type *SBP = Context.getPointerTypeUnqual(Type::Int8Ty);
+  const Type *SBP = PointerType::getUnqual(Type::Int8Ty);
   const Type *IntPtr = TD.getIntPtrType();
   Value *Ops[4] = {
     BitCastToType(DestPtr, SBP),
@@ -1428,8 +1428,8 @@
   
   // The idea is that it's a pointer to type "Value"
   // which is opaque* but the routine expects i8** and i8*.
-  const PointerType *Ty = Context.getPointerTypeUnqual(Type::Int8Ty);
-  V = Builder.CreateBitCast(V, Context.getPointerTypeUnqual(Ty));
+  const PointerType *Ty = PointerType::getUnqual(Type::Int8Ty);
+  V = Builder.CreateBitCast(V, PointerType::getUnqual(Ty));
   
   Value *Ops[2] = {
     V,
@@ -1455,7 +1455,7 @@
   Constant *lineNo =
     ConstantInt::get(Type::Int32Ty, DECL_SOURCE_LINE(decl));
   Constant *file = ConvertMetadataStringToGV(DECL_SOURCE_FILE(decl));
-  const Type *SBP= Context.getPointerTypeUnqual(Type::Int8Ty);
+  const Type *SBP= PointerType::getUnqual(Type::Int8Ty);
   file = Builder.getFolder().CreateBitCast(file, SBP);
   
   // There may be multiple annotate attributes. Pass return of lookup_attr 
@@ -1475,7 +1475,7 @@
       // Assert its a string, and then get that string.
       assert(TREE_CODE(val) == STRING_CST &&
              "Annotate attribute arg should always be a string");
-      const Type *SBP = Context.getPointerTypeUnqual(Type::Int8Ty);
+      const Type *SBP = PointerType::getUnqual(Type::Int8Ty);
       Constant *strGV = TreeConstantToLLVM::EmitLV_STRING_CST(val);
       Value *Ops[4] = {
         BitCastToType(V, SBP),
@@ -1883,7 +1883,7 @@
 
   const Type *IntPtr = TD.getIntPtrType();
 
-  ExceptionValue = CreateTemporary(Context.getPointerTypeUnqual(Type::Int8Ty));
+  ExceptionValue = CreateTemporary(PointerType::getUnqual(Type::Int8Ty));
   ExceptionValue->setName("eh_exception");
 
   ExceptionSelectorValue = CreateTemporary(IntPtr);
@@ -1945,7 +1945,7 @@
     assert(llvm_eh_personality_libfunc
            && "no exception handling personality function!");
     Args.push_back(BitCastToType(DECL_LLVM(llvm_eh_personality_libfunc),
-                                 Context.getPointerTypeUnqual(Type::Int8Ty)));
+                                 PointerType::getUnqual(Type::Int8Ty)));
 
     // Add selections for each handler.
     foreach_reachable_handler(i, false, AddHandler, &Handlers);
@@ -1977,7 +1977,7 @@
         if (!TypeList) {
           // Catch-all - push a null pointer.
           Args.push_back(
-            Context.getNullValue(Context.getPointerTypeUnqual(Type::Int8Ty))
+            Context.getNullValue(PointerType::getUnqual(Type::Int8Ty))
           );
         } else {
           // Add the type infos.
@@ -2004,7 +2004,7 @@
         if (catch_all_type == NULL_TREE)
           // Use a C++ style null catch-all object.
           Catch_All = Context.getNullValue(
-                                    Context.getPointerTypeUnqual(Type::Int8Ty));
+                                    PointerType::getUnqual(Type::Int8Ty));
         else
           // This language has a type that catches all others.
           Catch_All = Emit(catch_all_type, 0);
@@ -2069,7 +2069,7 @@
       for (; TypeList; TypeList = TREE_CHAIN (TypeList)) {
         Value *TType = Emit(lookup_type_for_runtime(TREE_VALUE(TypeList)), 0);
         TType = BitCastToType(TType, 
-                              Context.getPointerTypeUnqual(Type::Int8Ty));
+                              PointerType::getUnqual(Type::Int8Ty));
 
         // Call get eh type id.
         Value *TypeID = Builder.CreateCall(FuncEHGetTypeID, TType, "eh_typeid");
@@ -2213,7 +2213,7 @@
   if (!LV.isBitfield()) {
     if (!DestLoc) {
       // Scalar value: emit a load.
-      Value *Ptr = BitCastToType(LV.Ptr, Context.getPointerTypeUnqual(Ty));
+      Value *Ptr = BitCastToType(LV.Ptr, PointerType::getUnqual(Ty));
       LoadInst *LI = Builder.CreateLoad(Ptr, isVolatile);
       LI->setAlignment(Alignment);
       return LI;
@@ -2342,7 +2342,7 @@
   // If this is a direct call to a function using a static chain then we need
   // to ensure the function type is the one just calculated: it has an extra
   // parameter for the chain.
-  Callee = BitCastToType(Callee, Context.getPointerTypeUnqual(Ty));
+  Callee = BitCastToType(Callee, PointerType::getUnqual(Ty));
 
   // EmitCall(exp, DestLoc);
   Value *Result = EmitCallOf(Callee, exp, DestLoc, PAL);
@@ -2369,7 +2369,7 @@
   // Not clear what this is supposed to do on big endian machines...
   assert(!BYTES_BIG_ENDIAN && "Unsupported case - please report");
   assert(isa<IntegerType>(LLVMTy) && "Expected an integer value!");
-  const Type *LoadType = Context.getIntegerType(RealSize * 8);
+  const Type *LoadType = IntegerType::get(RealSize * 8);
   L = Builder.CreateBitCast(L, LoadType->getPointerTo());
   Value *Val = Builder.CreateLoad(L);
   if (LoadType->getPrimitiveSizeInBits() >= LLVMTy->getPrimitiveSizeInBits())
@@ -2442,7 +2442,7 @@
       Value *Loc = LocStack.back();
       if (Loc) {
         // An address.  Convert to the right type and load the value out.
-        Loc = Builder.CreateBitCast(Loc, Context.getPointerTypeUnqual(Ty));
+        Loc = Builder.CreateBitCast(Loc, PointerType::getUnqual(Ty));
         return Builder.CreateLoad(Loc, "val");
       } else {
         // A value - just return it.
@@ -2585,7 +2585,7 @@
     /// reference with an additional parameter attribute "ByVal".
     void HandleByValArgument(const llvm::Type *LLVMTy, tree type) {
       Value *Loc = getAddress();
-      assert(Context.getPointerTypeUnqual(LLVMTy) == Loc->getType());
+      assert(PointerType::getUnqual(LLVMTy) == Loc->getType());
       CallOperands.push_back(Loc);
     }
 
@@ -2593,7 +2593,7 @@
     /// argument is passed as a first class aggregate.
     void HandleFCAArgument(const llvm::Type *LLVMTy, tree type) {
       Value *Loc = getAddress();
-      assert(Context.getPointerTypeUnqual(LLVMTy) == Loc->getType());
+      assert(PointerType::getUnqual(LLVMTy) == Loc->getType());
       CallOperands.push_back(Builder.CreateLoad(Loc));
     }
 
@@ -2602,7 +2602,7 @@
     /// LLVM Struct, StructTy is the LLVM type of the struct we are entering.
     void EnterField(unsigned FieldNo, const llvm::Type *StructTy) {
       Value *Loc = getAddress();
-      Loc = Builder.CreateBitCast(Loc, Context.getPointerTypeUnqual(StructTy));
+      Loc = Builder.CreateBitCast(Loc, PointerType::getUnqual(StructTy));
       pushAddress(Builder.CreateStructGEP(Loc, FieldNo, "elt"));
     }
     void ExitField() {
@@ -2763,7 +2763,7 @@
 
   if (Client.isAggrReturn()) {
     Value *Dest = BitCastToType(DestLoc->Ptr,
-                                Context.getPointerTypeUnqual(Call->getType()));
+                                PointerType::getUnqual(Call->getType()));
     LLVM_EXTRACT_MULTIPLE_RETURN_VALUE(Call,Dest,DestLoc->Volatile,Builder);
     return 0;
   }
@@ -2779,11 +2779,11 @@
 
   Value *Ptr = DestLoc->Ptr;
   if (Client.Offset) {
-    Ptr = BitCastToType(Ptr, Context.getPointerTypeUnqual(Type::Int8Ty));
+    Ptr = BitCastToType(Ptr, PointerType::getUnqual(Type::Int8Ty));
     Ptr = Builder.CreateGEP(Ptr,
                     ConstantInt::get(TD.getIntPtrType(), Client.Offset));
   }
-  Ptr = BitCastToType(Ptr, Context.getPointerTypeUnqual(Call->getType()));
+  Ptr = BitCastToType(Ptr, PointerType::getUnqual(Call->getType()));
   StoreInst *St = Builder.CreateStore(Call, Ptr, DestLoc->Volatile);
   St->setAlignment(DestLoc->getAlignment());
   return 0;
@@ -2914,7 +2914,7 @@
         RHS = CastToAnyType(RHS, RHSSigned, PT->getElementType(), LHSSigned);
       else
         LV.Ptr = BitCastToType(LV.Ptr, 
-                               Context.getPointerTypeUnqual(RHS->getType()));
+                               PointerType::getUnqual(RHS->getType()));
       StoreInst *SI = Builder.CreateStore(RHS, LV.Ptr, isVolatile);
       SI->setAlignment(Alignment);
       return RHS;
@@ -3026,7 +3026,7 @@
   } else if (isAggregateTreeType(TREE_TYPE(Op))) {
     // Aggregate to aggregate copy.
     MemRef NewLoc = *DestLoc;
-    NewLoc.Ptr = BitCastToType(DestLoc->Ptr, Context.getPointerTypeUnqual(Ty));
+    NewLoc.Ptr = BitCastToType(DestLoc->Ptr, PointerType::getUnqual(Ty));
     Value *OpVal = Emit(Op, &NewLoc);
     assert(OpVal == 0 && "Shouldn't cast scalar to aggregate!");
     return 0;
@@ -3035,7 +3035,7 @@
   // Scalar to aggregate copy.
   Value *OpVal = Emit(Op, 0);
   Value *Ptr = BitCastToType(DestLoc->Ptr, 
-                             Context.getPointerTypeUnqual(OpVal->getType()));
+                             PointerType::getUnqual(OpVal->getType()));
   StoreInst *St = Builder.CreateStore(OpVal, Ptr, DestLoc->Volatile);
   St->setAlignment(DestLoc->getAlignment());
   return 0;
@@ -3063,7 +3063,7 @@
 
     // Make the destination look like the source type.
     const Type *OpTy = ConvertType(TREE_TYPE(Op));
-    Target.Ptr = BitCastToType(Target.Ptr, Context.getPointerTypeUnqual(OpTy));
+    Target.Ptr = BitCastToType(Target.Ptr, PointerType::getUnqual(OpTy));
 
     // Needs to be in sync with EmitLV.
     switch (TREE_CODE(Op)) {
@@ -3103,7 +3103,7 @@
     // Target holds the temporary created above.
     const Type *ExpTy = ConvertType(TREE_TYPE(exp));
     return Builder.CreateLoad(BitCastToType(Target.Ptr,
-                                          Context.getPointerTypeUnqual(ExpTy)));
+                                          PointerType::getUnqual(ExpTy)));
   }
   
   if (DestLoc) {
@@ -3112,7 +3112,7 @@
     Value *OpVal = Emit(Op, 0);
     assert(OpVal && "Expected a scalar result!");
     Value *Ptr = BitCastToType(DestLoc->Ptr,
-                               Context.getPointerTypeUnqual(OpVal->getType()));
+                               PointerType::getUnqual(OpVal->getType()));
     StoreInst *St = Builder.CreateStore(OpVal, Ptr, DestLoc->Volatile);
     St->setAlignment(DestLoc->getAlignment());
     return 0;
@@ -3232,10 +3232,10 @@
   if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
     unsigned NumElements = VTy->getNumElements();
     const Type *EltTy = VTy->getElementType();
-    return Context.getVectorType(
-      Context.getIntegerType(EltTy->getPrimitiveSizeInBits()), NumElements);
+    return VectorType::get(
+      IntegerType::get(EltTy->getPrimitiveSizeInBits()), NumElements);
   }
-  return Context.getIntegerType(Ty->getPrimitiveSizeInBits());
+  return IntegerType::get(Ty->getPrimitiveSizeInBits());
 }
 
 Value *TreeToLLVM::EmitBIT_NOT_EXPR(tree exp) {
@@ -3816,8 +3816,7 @@
   }
 
   // Turn this into a 'tmp = call Ty asm "", "={reg}"()'.
-  FunctionType *FTy =
-    Context.getFunctionType(Ty, std::vector<const Type*>(),false);
+  FunctionType *FTy = FunctionType::get(Ty, std::vector<const Type*>(),false);
 
   const char *Name = reg_names[decode_reg_name(extractRegisterName(decl))];
 
@@ -3837,7 +3836,7 @@
   // Turn this into a 'call void asm sideeffect "", "{reg}"(Ty %RHS)'.
   std::vector<const Type*> ArgTys;
   ArgTys.push_back(ConvertType(TREE_TYPE(decl)));
-  FunctionType *FTy = Context.getFunctionType(Type::VoidTy, ArgTys, false);
+  FunctionType *FTy = FunctionType::get(Type::VoidTy, ArgTys, false);
 
   const char *Name = reg_names[decode_reg_name(extractRegisterName(decl))];
 
@@ -4422,9 +4421,9 @@
         uint64_t TySize = TD.getTypeSizeInBits(LLVMTy);
         if (TySize == 1 || TySize == 8 || TySize == 16 ||
             TySize == 32 || TySize == 64) {
-          LLVMTy = Context.getIntegerType(TySize);
+          LLVMTy = IntegerType::get(TySize);
           Op = Builder.CreateLoad(BitCastToType(LV.Ptr,
-                                 Context.getPointerTypeUnqual(LLVMTy)));
+                                 PointerType::getUnqual(LLVMTy)));
         } else {
           // Otherwise, emit our value as a lvalue and let the codegen deal with
           // it.
@@ -4554,12 +4553,12 @@
   default: 
     std::vector<const Type*> TmpVec(CallResultTypes.begin(),
                                     CallResultTypes.end());
-    CallResultType = Context.getStructType(TmpVec);
+    CallResultType = StructType::get(TmpVec);
     break;
   }
   
   const FunctionType *FTy = 
-    Context.getFunctionType(CallResultType, CallArgTypes, false);
+    FunctionType::get(CallResultType, CallArgTypes, false);
   
   // Remove the leading comma if we have operands.
   if (!ConstraintStr.empty())
@@ -4621,7 +4620,7 @@
   
   // Otherwise, insertelement the values to build the vector.
   Value *Result = 
-    Context.getUndef(Context.getVectorType(Ops[0]->getType(), Ops.size()));
+    Context.getUndef(VectorType::get(Ops[0]->getType(), Ops.size()));
   
   for (unsigned i = 0, e = Ops.size(); i != e; ++i)
     Result = Builder.CreateInsertElement(Result, Ops[i], 
@@ -4746,7 +4745,7 @@
   };
   const Type* Ty[2];
   Ty[0] = ResultTy;
-  Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+  Ty[1] = PointerType::getUnqual(ResultTy);
   C[0] = Builder.CreateBitCast(C[0], Ty[1]);
   C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
   // The gcc builtins are also full memory barriers.
@@ -4771,7 +4770,7 @@
   };
   const Type* Ty[2];
   Ty[0] = ResultTy;
-  Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+  Ty[1] = PointerType::getUnqual(ResultTy);
   C[0] = Builder.CreateBitCast(C[0], Ty[1]);
   C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
   C[2] = Builder.CreateIntCast(C[2], Ty[0], "cast");
@@ -5083,7 +5082,7 @@
     location_t locus = EXPR_LOCATION (exp);
     Constant *lineNo = ConstantInt::get(Type::Int32Ty, locus.line);
     Constant *file = ConvertMetadataStringToGV(locus.file);
-    const Type *SBP= Context.getPointerTypeUnqual(Type::Int8Ty);
+    const Type *SBP= PointerType::getUnqual(Type::Int8Ty);
     file = Builder.getFolder().CreateBitCast(file, SBP);
     
     // Get arguments.
@@ -5256,7 +5255,7 @@
     };
     const Type* Ty[2];
     Ty[0] = ResultTy;
-    Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+    Ty[1] = PointerType::getUnqual(ResultTy);
     C[0] = Builder.CreateBitCast(C[0], Ty[1]);
     C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
     
@@ -5294,7 +5293,7 @@
     };
     const Type* Ty[2];
     Ty[0] = ResultTy;
-    Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+    Ty[1] = PointerType::getUnqual(ResultTy);
     C[0] = Builder.CreateBitCast(C[0], Ty[1]);
     C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
     
@@ -5332,7 +5331,7 @@
     };
     const Type* Ty[2];
     Ty[0] = ResultTy;
-    Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+    Ty[1] = PointerType::getUnqual(ResultTy);
     C[0] = Builder.CreateBitCast(C[0], Ty[1]);
     C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
     
@@ -5370,7 +5369,7 @@
     };
     const Type* Ty[2];
     Ty[0] = ResultTy;
-    Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+    Ty[1] = PointerType::getUnqual(ResultTy);
     C[0] = Builder.CreateBitCast(C[0], Ty[1]);
     C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
     
@@ -5408,7 +5407,7 @@
     };
     const Type* Ty[2];
     Ty[0] = ResultTy;
-    Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+    Ty[1] = PointerType::getUnqual(ResultTy);
     C[0] = Builder.CreateBitCast(C[0], Ty[1]);
     C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
     
@@ -5446,7 +5445,7 @@
     };
     const Type* Ty[2];
     Ty[0] = ResultTy;
-    Ty[1] = Context.getPointerTypeUnqual(ResultTy);
+    Ty[1] = PointerType::getUnqual(ResultTy);
     C[0] = Builder.CreateBitCast(C[0], Ty[1]);
     C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast");
     
@@ -5766,7 +5765,7 @@
   if (Locality == 0)
     Locality = ConstantInt::get(Type::Int32Ty, 3);
   
-  Ptr = BitCastToType(Ptr, Context.getPointerTypeUnqual(Type::Int8Ty));
+  Ptr = BitCastToType(Ptr, PointerType::getUnqual(Type::Int8Ty));
   
   Value *Ops[3] = { Ptr, ReadWrite, Locality };
   Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::prefetch),
@@ -5809,7 +5808,7 @@
   // Unfortunately, these constants are defined as RTL expressions and
   // should be handled separately.
   
-  Result = BitCastToType(Ptr, Context.getPointerTypeUnqual(Type::Int8Ty));
+  Result = BitCastToType(Ptr, PointerType::getUnqual(Type::Int8Ty));
 
   return true;
 }
@@ -5825,7 +5824,7 @@
   // needed for: MIPS, Sparc.  Unfortunately, these constants are defined
   // as RTL expressions and should be handled separately.
   
-  Result = BitCastToType(Ptr, Context.getPointerTypeUnqual(Type::Int8Ty));
+  Result = BitCastToType(Ptr, PointerType::getUnqual(Type::Int8Ty));
 
   return true;
 }
@@ -5933,7 +5932,7 @@
 		       Intrinsic::eh_return_i32 : Intrinsic::eh_return_i64);
 
   Offset = Builder.CreateIntCast(Offset, IntPtr, true);
-  Handler = BitCastToType(Handler, Context.getPointerTypeUnqual(Type::Int8Ty));
+  Handler = BitCastToType(Handler, PointerType::getUnqual(Type::Int8Ty));
 
   SmallVector<Value *, 2> Args;
   Args.push_back(Offset);
@@ -5962,7 +5961,7 @@
   }
 
   Value *Addr = BitCastToType(Emit(TREE_VALUE(arglist), 0),
-                              Context.getPointerTypeUnqual(Type::Int8Ty));
+                              PointerType::getUnqual(Type::Int8Ty));
   Constant *Size, *Idx;
 
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) {
@@ -6024,7 +6023,7 @@
     return false;
   
   Value *Ptr = Emit(TREE_VALUE(arglist), 0);
-  Ptr = BitCastToType(Ptr, Context.getPointerTypeUnqual(Type::Int8Ty));
+  Ptr = BitCastToType(Ptr, PointerType::getUnqual(Type::Int8Ty));
 
   Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
                                                Intrinsic::stackrestore), Ptr);
@@ -6078,14 +6077,14 @@
                                                          Intrinsic::vastart);
   const Type *FTy =
     cast<PointerType>(llvm_va_start_fn->getType())->getElementType();
-  ArgVal = BitCastToType(ArgVal, Context.getPointerTypeUnqual(Type::Int8Ty));
+  ArgVal = BitCastToType(ArgVal, PointerType::getUnqual(Type::Int8Ty));
   Builder.CreateCall(llvm_va_start_fn, ArgVal);
   return true;
 }
 
 bool TreeToLLVM::EmitBuiltinVAEnd(tree exp) {
   Value *Arg = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0);
-  Arg = BitCastToType(Arg, Context.getPointerTypeUnqual(Type::Int8Ty));
+  Arg = BitCastToType(Arg, PointerType::getUnqual(Type::Int8Ty));
   Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::vaend),
                      Arg);
   return true;
@@ -6110,7 +6109,7 @@
     Arg2 = Emit(Arg2T, 0);
   }
 
-  static const Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
+  static const Type *VPTy = PointerType::getUnqual(Type::Int8Ty);
 
   // FIXME: This ignores alignment and volatility of the arguments.
   SmallVector<Value *, 2> Args;
@@ -6128,7 +6127,7 @@
                          VOID_TYPE))
     return false;
 
-  static const Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
+  static const Type *VPTy = PointerType::getUnqual(Type::Int8Ty);
 
   Value *Tramp = Emit(TREE_VALUE(arglist), 0);
   Tramp = BitCastToType(Tramp, VPTy);
@@ -6323,7 +6322,7 @@
   tree AnnotateAttr = lookup_attribute("annotate", DECL_ATTRIBUTES(FieldDecl));
 
   const Type *OrigPtrTy = FieldPtr->getType();
-  const Type *SBP = Context.getPointerTypeUnqual(Type::Int8Ty);
+  const Type *SBP = PointerType::getUnqual(Type::Int8Ty);
 
   Function *Fn = Intrinsic::getDeclaration(TheModule,
                                            Intrinsic::ptr_annotation,
@@ -6442,7 +6441,7 @@
     const Type *ElementTy = ConvertType(ElementType);
     unsigned Alignment = MinAlign(ArrayAlign, TD.getABITypeAlignment(ElementTy));
     return LValue(BitCastToType(Ptr,
-                  Context.getPointerTypeUnqual(ConvertType(TREE_TYPE(exp)))),
+                  PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))),
                   Alignment);
   }
 
@@ -6451,7 +6450,7 @@
   //   float foo(int w, float A[][w], int g) { return A[g][0]; }
 
   ArrayAddr = BitCastToType(ArrayAddr,
-                            Context.getPointerTypeUnqual(Type::Int8Ty));
+                            PointerType::getUnqual(Type::Int8Ty));
   if (VOID_TYPE_P(TREE_TYPE(ArrayTreeType)))
     return LValue(Builder.CreateGEP(ArrayAddr, IndexVal), 1);
 
@@ -6464,7 +6463,7 @@
                          cast<ConstantInt>(IndexVal)->getZExtValue());
   Value *Ptr = Builder.CreateGEP(ArrayAddr, IndexVal);
   return LValue(BitCastToType(Ptr,
-                Context.getPointerTypeUnqual(ConvertType(TREE_TYPE(exp)))),
+                PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))),
                 Alignment);
 }
 
@@ -6490,7 +6489,7 @@
   if (unsigned UnitOffset = BitStart / ValueSizeInBits) {
     // TODO: If Ptr.Ptr is a struct type or something, we can do much better
     // than this.  e.g. check out when compiling unwind-dw2-fde-darwin.c.
-    Ptr.Ptr = BitCastToType(Ptr.Ptr, Context.getPointerTypeUnqual(ValTy));
+    Ptr.Ptr = BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy));
     Ptr.Ptr = Builder.CreateGEP(Ptr.Ptr,
                             ConstantInt::get(Type::Int32Ty, UnitOffset));
     BitStart -= UnitOffset*ValueSizeInBits;
@@ -6498,11 +6497,11 @@
 
   // If this is referring to the whole field, return the whole thing.
   if (BitStart == 0 && BitSize == ValueSizeInBits) {
-    return LValue(BitCastToType(Ptr.Ptr, Context.getPointerTypeUnqual(ValTy)),
+    return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)),
                   Ptr.getAlignment());
   }
 
-  return LValue(BitCastToType(Ptr.Ptr, Context.getPointerTypeUnqual(ValTy)), 1,
+  return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)), 1,
                 BitStart, BitSize);
 }
 
@@ -6525,7 +6524,7 @@
           StructAddrLV.BitStart == 0) && "structs cannot be bitfields!");
 
   StructAddrLV.Ptr = BitCastToType(StructAddrLV.Ptr,
-                                   Context.getPointerTypeUnqual(StructTy));
+                                   PointerType::getUnqual(StructTy));
   const Type *FieldTy = ConvertType(getDeclaredType(FieldDecl));
 
   // BitStart - This is the actual offset of the field from the start of the
@@ -6602,7 +6601,7 @@
                             Offset->getType());
     Ptr = Builder.CreateAdd(Ptr, Offset);
     FieldPtr = CastToType(Instruction::IntToPtr, Ptr,
-                          Context.getPointerTypeUnqual(FieldTy));
+                          PointerType::getUnqual(FieldTy));
   }
 
   if (isBitfield(FieldDecl)) {
@@ -6635,14 +6634,14 @@
       // sized like an i24 there may be trouble: incrementing a T* will move
       // the position by 32 bits not 24, leaving the upper 8 of those 32 bits
       // inaccessible.  Avoid this by rounding up the size appropriately.
-      FieldTy = Context.getIntegerType(TD.getTypeAllocSizeInBits(FieldTy));
+      FieldTy = IntegerType::get(TD.getTypeAllocSizeInBits(FieldTy));
 
     assert(FieldTy->getPrimitiveSizeInBits() ==
            TD.getTypeAllocSizeInBits(FieldTy) && "Field type not sequential!");
 
     // If this is a bitfield, the field may span multiple fields in the LLVM
     // type.  As such, cast the pointer to be a pointer to the declared type.
-    FieldPtr = BitCastToType(FieldPtr, Context.getPointerTypeUnqual(FieldTy));
+    FieldPtr = BitCastToType(FieldPtr, PointerType::getUnqual(FieldTy));
 
     unsigned LLVMValueBitSize = FieldTy->getPrimitiveSizeInBits();
     // Finally, because bitfields can span LLVM fields, and because the start
@@ -6674,7 +6673,7 @@
                             Offset->getType());
       FieldPtr = Builder.CreateAdd(FieldPtr, Offset);
       FieldPtr = CastToType(Instruction::IntToPtr, FieldPtr,
-                            Context.getPointerTypeUnqual(FieldTy));
+                            PointerType::getUnqual(FieldTy));
 
       // Adjust bitstart to account for the pointer movement.
       BitStart -= ByteOffset*8;
@@ -6695,7 +6694,7 @@
   } else {
     // Make sure we return a pointer to the right type.
     const Type *EltTy = ConvertType(TREE_TYPE(exp));
-    FieldPtr = BitCastToType(FieldPtr, Context.getPointerTypeUnqual(EltTy));
+    FieldPtr = BitCastToType(FieldPtr, PointerType::getUnqual(EltTy));
   }
 
   assert(BitStart == 0 &&
@@ -6736,7 +6735,7 @@
   if (Decl == 0) {
     if (errorcount || sorrycount) {
       const Type *Ty = ConvertType(TREE_TYPE(exp));
-      const PointerType *PTy = Context.getPointerTypeUnqual(Ty);
+      const PointerType *PTy = PointerType::getUnqual(Ty);
       LValue LV(Context.getConstantPointerNull(PTy), 1);
       return LV;
     }
@@ -6773,8 +6772,8 @@
   const Type *Ty = ConvertType(TREE_TYPE(exp));
   // If we have "extern void foo", make the global have type {} instead of
   // type void.
-  if (Ty == Type::VoidTy) Ty = Context.getStructType(NULL, NULL);
-  const PointerType *PTy = Context.getPointerTypeUnqual(Ty);
+  if (Ty == Type::VoidTy) Ty = StructType::get(NULL, NULL);
+  const PointerType *PTy = PointerType::getUnqual(Ty);
   unsigned Alignment = Ty->isSized() ? TD.getABITypeAlignment(Ty) : 1;
   if (DECL_ALIGN(exp)) {
     if (DECL_USER_ALIGN(exp) || 8 * Alignment < (unsigned)DECL_ALIGN(exp))
@@ -6790,7 +6789,7 @@
   unsigned Alignment = TD.getABITypeAlignment(cast<PointerType>(ExceptionValue->
                                                   getType())->getElementType());
   return LValue(BitCastToType(ExceptionValue,
-                    Context.getPointerTypeUnqual(ConvertType(TREE_TYPE(exp)))),
+                    PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))),
                 Alignment);
 }
 
@@ -6819,7 +6818,7 @@
     LValue LV = EmitLV(Op);
     // The type is the type of the expression.
     LV.Ptr = BitCastToType(LV.Ptr,
-                     Context.getPointerTypeUnqual(ConvertType(TREE_TYPE(exp))));
+                     PointerType::getUnqual(ConvertType(TREE_TYPE(exp))));
     return LV;
   } else {
     // If the input is a scalar, emit to a temporary.
@@ -6827,7 +6826,7 @@
     StoreInst *S = Builder.CreateStore(Emit(Op, 0), Dest);
     // The type is the type of the expression.
     Dest = BitCastToType(Dest,
-                     Context.getPointerTypeUnqual(ConvertType(TREE_TYPE(exp))));
+                     PointerType::getUnqual(ConvertType(TREE_TYPE(exp))));
     return LValue(Dest, 1);
   }
 }
@@ -6922,7 +6921,7 @@
       // Scalar value.  Evaluate to a register, then do the store.
       Value *V = Emit(tree_value, 0);
       Value *Ptr = BitCastToType(DestLoc->Ptr, 
-                                 Context.getPointerTypeUnqual(V->getType()));
+                                 PointerType::getUnqual(V->getType()));
       StoreInst *St = Builder.CreateStore(V, Ptr, DestLoc->Volatile);
       St->setAlignment(DestLoc->getAlignment());
     }
@@ -7103,7 +7102,7 @@
       tree Domain = TYPE_DOMAIN(TREE_TYPE(exp));
       if (!Domain || !TYPE_MAX_VALUE(Domain)) {
         ConstantSize = LenInElts;
-        StrTy = Context.getArrayType(ElTy, LenInElts);
+        StrTy = ArrayType::get(ElTy, LenInElts);
       }
     }
     
@@ -7309,7 +7308,7 @@
   
   if (AllEltsSameType)
     return ConstantArray::get(
-      Context.getArrayType(ElTy, ResultElts.size()), ResultElts);
+      ArrayType::get(ElTy, ResultElts.size()), ResultElts);
   return ConstantStruct::get(ResultElts, false);
 }
 
@@ -7377,7 +7376,7 @@
     // Otherwise, there is padding here.  Insert explicit zeros.
     const Type *PadTy = Type::Int8Ty;
     if (AlignedEltOffs-EltOffs != 1)
-      PadTy = Context.getArrayType(PadTy, AlignedEltOffs-EltOffs);
+      PadTy = ArrayType::get(PadTy, AlignedEltOffs-EltOffs);
     ResultElts.insert(ResultElts.begin()+i, 
                       Context.getNullValue(PadTy));
     
@@ -7464,7 +7463,7 @@
     // not get the same alignment as "Val".
     const Type *FillTy = Type::Int8Ty;
     if (GCCFieldOffsetInBits/8-NextFieldByteStart != 1)
-      FillTy = Context.getArrayType(FillTy,
+      FillTy = ArrayType::get(FillTy,
                               GCCFieldOffsetInBits/8-NextFieldByteStart);
     ResultElts.push_back(Context.getNullValue(FillTy));
 
@@ -7651,7 +7650,7 @@
   if (LLVMNaturalSize < GCCStructSize) {
     const Type *FillTy = Type::Int8Ty;
     if (GCCStructSize - NextFieldByteStart != 1)
-      FillTy = Context.getArrayType(FillTy, GCCStructSize - NextFieldByteStart);
+      FillTy = ArrayType::get(FillTy, GCCStructSize - NextFieldByteStart);
     ResultElts.push_back(Context.getNullValue(FillTy));
     NextFieldByteStart = GCCStructSize;
   
@@ -7759,7 +7758,7 @@
       if (UnionSize - InitSize == 1)
         FillTy = Type::Int8Ty;
       else
-        FillTy = Context.getArrayType(Type::Int8Ty, UnionSize - InitSize);
+        FillTy = ArrayType::get(Type::Int8Ty, UnionSize - InitSize);
       Elts.push_back(Context.getNullValue(FillTy));
     }
   }
@@ -7878,7 +7877,7 @@
   BasicBlock *BB = getLabelDeclBlock(exp);
   Constant *C = TheTreeToLLVM->getIndirectGotoBlockNumber(BB);
   return
-       TheFolder->CreateIntToPtr(C, Context.getPointerTypeUnqual(Type::Int8Ty));
+       TheFolder->CreateIntToPtr(C, PointerType::getUnqual(Type::Int8Ty));
 }
 
 Constant *TreeConstantToLLVM::EmitLV_COMPLEX_CST(tree exp) {
@@ -7978,7 +7977,7 @@
   tree FieldDecl = TREE_OPERAND(exp, 1);
   
   StructAddrLV = TheFolder->CreateBitCast(StructAddrLV,
-                                      Context.getPointerTypeUnqual(StructTy));
+                                      PointerType::getUnqual(StructTy));
   const Type *FieldTy = ConvertType(getDeclaredType(FieldDecl));
   
   // BitStart - This is the actual offset of the field from the start of the
@@ -8016,13 +8015,13 @@
     Constant *Ptr = TheFolder->CreatePtrToInt(StructAddrLV, Offset->getType());
     Ptr = TheFolder->CreateAdd(Ptr, Offset);
     FieldPtr = TheFolder->CreateIntToPtr(Ptr, 
-                                         Context.getPointerTypeUnqual(FieldTy));
+                                         PointerType::getUnqual(FieldTy));
   }
 
   // Make sure we return a result of the right type.
-  if (Context.getPointerTypeUnqual(FieldTy) != FieldPtr->getType())
+  if (PointerType::getUnqual(FieldTy) != FieldPtr->getType())
     FieldPtr = TheFolder->CreateBitCast(FieldPtr,
-                                        Context.getPointerTypeUnqual(FieldTy));
+                                        PointerType::getUnqual(FieldTy));
 
   assert(BitStart == 0 &&
          "It's a bitfield reference or we didn't get to the field!");

Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=77515&r1=77514&r2=77515&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Wed Jul 29 17:17:04 2009
@@ -223,7 +223,7 @@
   for (unsigned i = 0, e = ArgTys.size(); i != e; ++i)
     ArgTysP.push_back(ArgTys[i]);
   
-  return Context.getFunctionType(Res, ArgTysP, isVarArg);
+  return FunctionType::get(Res, ArgTysP, isVarArg);
 }
 
 //===----------------------------------------------------------------------===//
@@ -711,7 +711,7 @@
     if (const Type *Ty = GET_TYPE_LLVM(type))
       return Ty;
     return SET_TYPE_LLVM(type,
-                     Context.getIntegerType(TREE_INT_CST_LOW(TYPE_SIZE(type))));
+                     IntegerType::get(TREE_INT_CST_LOW(TYPE_SIZE(type))));
   }
   case ENUMERAL_TYPE:
     // Use of an enum that is implicitly declared?
@@ -720,7 +720,7 @@
       if (const Type *Ty = GET_TYPE_LLVM(orig_type))
         return Ty;
 
-      const Type *Ty = Context.getOpaqueType();
+      const Type *Ty = OpaqueType::get();
       TheModule->addTypeName(GetTypeName("enum.", orig_type), Ty);
       return TypeDB.setType(orig_type, Ty);
     }
@@ -731,7 +731,7 @@
     // The ARM port defines __builtin_neon_xi as a 511-bit type because GCC's
     // type precision field has only 9 bits.  Treat this as a special case.
     int precision = TYPE_PRECISION(type) == 511 ? 512 : TYPE_PRECISION(type);
-    return SET_TYPE_LLVM(type, Context.getIntegerType(precision));
+    return SET_TYPE_LLVM(type, IntegerType::get(precision));
   }
   case REAL_TYPE:
     if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty;
@@ -752,7 +752,7 @@
 #else
       // 128-bit long doubles map onto { double, double }.
       return SET_TYPE_LLVM(type,
-                           Context.getStructType(Type::DoubleTy, Type::DoubleTy,
+                           StructType::get(Type::DoubleTy, Type::DoubleTy,
                                                  NULL));
 #endif
     }
@@ -761,13 +761,13 @@
     if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty;
     const Type *Ty = ConvertType(TREE_TYPE(type));
     assert(!Ty->isAbstract() && "should use TypeDB.setType()");
-    return SET_TYPE_LLVM(type, Context.getStructType(Ty, Ty, NULL));
+    return SET_TYPE_LLVM(type, StructType::get(Ty, Ty, NULL));
   }
   case VECTOR_TYPE: {
     if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty;
     const Type *Ty = ConvertType(TREE_TYPE(type));
     assert(!Ty->isAbstract() && "should use TypeDB.setType()");
-    Ty = Context.getVectorType(Ty, TYPE_VECTOR_SUBPARTS(type));
+    Ty = VectorType::get(Ty, TYPE_VECTOR_SUBPARTS(type));
     return SET_TYPE_LLVM(type, Ty);
   }
     
@@ -824,7 +824,7 @@
         if (Ty == 0) {
           PointersToReresolve.push_back(type);
           return TypeDB.setType(type, 
-                         Context.getPointerTypeUnqual(Context.getOpaqueType()));
+                         PointerType::getUnqual(OpaqueType::get()));
         }
 
         // A type has already been computed.  However, this may be some sort of 
@@ -842,7 +842,7 @@
     
       if (Ty == Type::VoidTy) 
         Ty = Type::Int8Ty;  // void* -> sbyte*
-      return TypeDB.setType(type, Context.getPointerTypeUnqual(Ty));
+      return TypeDB.setType(type, PointerType::getUnqual(Ty));
     }
    
   case METHOD_TYPE:
@@ -904,7 +904,7 @@
       NumElements /= ElementSize;
     }
 
-    return TypeDB.setType(type, Context.getArrayType(ElementTy, NumElements));
+    return TypeDB.setType(type, ArrayType::get(ElementTy, NumElements));
   }
   case OFFSET_TYPE:
     // Handle OFFSET_TYPE specially.  This is used for pointers to members,
@@ -1012,7 +1012,7 @@
     /// argument is passed by value. It is lowered to a parameter passed by
     /// reference with an additional parameter attribute "ByVal".
     void HandleByValArgument(const llvm::Type *LLVMTy, tree type) {
-      HandleScalarArgument(Context.getPointerTypeUnqual(LLVMTy), type);
+      HandleScalarArgument(PointerType::getUnqual(LLVMTy), type);
     }
 
     /// HandleFCAArgument - This callback is invoked if the aggregate function
@@ -1358,7 +1358,7 @@
   const Type *getLLVMType() const {
     // Use Packed type if Packed is set or all struct fields are bitfields.
     // Empty struct is not packed unless packed is set.
-    return Context.getStructType(Elements,
+    return StructType::get(Elements,
                            Packed || (!Elements.empty() && AllBitFields));
   }
   
@@ -1411,7 +1411,7 @@
     assert (PadBytes > 0 && "Unable to remove extra bytes");
 
     // Update last element type and size, element offset is unchanged.
-    const Type *Pad =  Context.getArrayType(Type::Int8Ty, PadBytes);
+    const Type *Pad =  ArrayType::get(Type::Int8Ty, PadBytes);
     unsigned OriginalSize = ElementSizeInBytes.back();
     Elements.pop_back();
     Elements.push_back(Pad);
@@ -1448,7 +1448,7 @@
           // different offset.
           const Type *Pad = Type::Int8Ty;
           if (PoppedOffset != EndOffset + 1)
-            Pad = Context.getArrayType(Pad, PoppedOffset - EndOffset);
+            Pad = ArrayType::get(Pad, PoppedOffset - EndOffset);
           addElement(Pad, EndOffset, PoppedOffset - EndOffset);
         }
       }
@@ -1480,7 +1480,7 @@
         //  In this example, previous field is C and D is current field.
         addElement(SavedTy, CurOffset, ByteOffset - CurOffset);
       else if (ByteOffset - CurOffset != 1)
-        Pad = Context.getArrayType(Pad, ByteOffset - CurOffset);
+        Pad = ArrayType::get(Pad, ByteOffset - CurOffset);
       addElement(Pad, CurOffset, ByteOffset - CurOffset);
     }
     return true;
@@ -1620,7 +1620,7 @@
   unsigned ByteAlignment = getTypeAlignment(NewFieldTy);
   if (FirstUnallocatedByte & (ByteAlignment-1)) {
     // Instead of inserting a nice whole field, insert a small array of ubytes.
-    NewFieldTy = Context.getArrayType(Type::Int8Ty, (Size+7)/8);
+    NewFieldTy = ArrayType::get(Type::Int8Ty, (Size+7)/8);
   }
   
   // Finally, add the new field.
@@ -2084,7 +2084,7 @@
     if (PadBytes) {
       const Type *Pad = Type::Int8Ty;
       if (PadBytes != 1)
-        Pad = Context.getArrayType(Pad, PadBytes);
+        Pad = ArrayType::get(Pad, PadBytes);
       Info.addElement(Pad, FirstUnallocatedByte, PadBytes);
     }
 
@@ -2136,7 +2136,7 @@
   }
 
   if (TYPE_SIZE(type) == 0) {   // Forward declaration?
-    const Type *Ty = Context.getOpaqueType();
+    const Type *Ty = OpaqueType::get();
     TheModule->addTypeName(GetTypeName("struct.", orig_type), Ty);
     return TypeDB.setType(type, Ty);
   }
@@ -2200,12 +2200,12 @@
           // insert array of i32
           unsigned Int32ArraySize = (GCCTypeSize-LLVMStructSize)/4;
           const Type *PadTy =
-            Context.getArrayType(Type::Int32Ty, Int32ArraySize);
+            ArrayType::get(Type::Int32Ty, Int32ArraySize);
           Info->addElement(PadTy, GCCTypeSize - LLVMLastElementEnd,
                            Int32ArraySize, true /* Padding Element */);
         } else {
           const Type *PadTy =
-            Context.getArrayType(Type::Int8Ty, GCCTypeSize-LLVMStructSize);
+            ArrayType::get(Type::Int8Ty, GCCTypeSize-LLVMStructSize);
           Info->addElement(PadTy, GCCTypeSize - LLVMLastElementEnd,
                            GCCTypeSize - LLVMLastElementEnd,
                            true /* Padding Element */);
@@ -2314,7 +2314,7 @@
   }
 
   if (TYPE_SIZE(type) == 0) {   // Forward declaraion?
-    const Type *Ty = Context.getOpaqueType();
+    const Type *Ty = OpaqueType::get();
     TheModule->addTypeName(GetTypeName("union.", orig_type), Ty);
     return TypeDB.setType(type, Ty);
   }
@@ -2442,13 +2442,13 @@
              "LLVM type size doesn't match GCC type size!");
       const Type *PadTy = Type::Int8Ty;
       if (GCCTypeSize-EltSize != 1)
-        PadTy = Context.getArrayType(PadTy, GCCTypeSize-EltSize);
+        PadTy = ArrayType::get(PadTy, GCCTypeSize-EltSize);
       UnionElts.push_back(PadTy);
     }
   }
 
   bool isPacked = 8 * EltAlign > TYPE_ALIGN(type);
-  const Type *ResultTy = Context.getStructType(UnionElts, isPacked);
+  const Type *ResultTy = StructType::get(UnionElts, isPacked);
   const OpaqueType *OldTy = cast_or_null<OpaqueType>(GET_TYPE_LLVM(type));
   TypeDB.setType(type, ResultTy);
 





More information about the llvm-commits mailing list