[cfe-commits] r77638 - in /cfe/trunk/lib/CodeGen: CGBuiltin.cpp CGCXX.cpp CGExpr.cpp CGExprScalar.cpp CGObjCGNU.cpp CodeGenFunction.cpp CodeGenModule.cpp

Owen Anderson resistor at mac.com
Thu Jul 30 16:11:26 PDT 2009


Author: resistor
Date: Thu Jul 30 18:11:26 2009
New Revision: 77638

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

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/lib/CodeGen/CGCXX.cpp
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=77638&r1=77637&r2=77638&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Jul 30 18:11:26 2009
@@ -605,7 +605,7 @@
   // Unknown builtin, for now just dump it out and return undef.
   if (hasAggregateLLVMType(E->getType()))
     return RValue::getAggregate(CreateTempAlloca(ConvertType(E->getType())));
-  return RValue::get(VMContext.getUndef(ConvertType(E->getType())));
+  return RValue::get(llvm::UndefValue::get(ConvertType(E->getType())));
 }    
 
 Value *CodeGenFunction::EmitTargetBuiltinExpr(unsigned BuiltinID,
@@ -639,7 +639,7 @@
     Ops[1] = Builder.CreateZExt(Ops[1], llvm::Type::Int64Ty, "zext");
     const llvm::Type *Ty = llvm::VectorType::get(llvm::Type::Int64Ty, 2);
     llvm::Value *Zero = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0);
-    Ops[1] = Builder.CreateInsertElement(VMContext.getUndef(Ty),
+    Ops[1] = Builder.CreateInsertElement(llvm::UndefValue::get(Ty),
                                          Ops[1], Zero, "insert");
     Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "bitcast");
     const char *name = 0;

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=77638&r1=77637&r2=77638&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Thu Jul 30 18:11:26 2009
@@ -267,7 +267,7 @@
 llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
   if (E->isArray()) {
     ErrorUnsupported(E, "new[] expression");
-    return VMContext.getUndef(ConvertType(E->getType()));
+    return llvm::UndefValue::get(ConvertType(E->getType()));
   }
   
   QualType AllocType = E->getAllocatedType();

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=77638&r1=77637&r2=77638&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Thu Jul 30 18:11:26 2009
@@ -121,13 +121,13 @@
     return RValue::get(0);
   } else if (const ComplexType *CTy = Ty->getAsComplexType()) {
     const llvm::Type *EltTy = ConvertType(CTy->getElementType());
-    llvm::Value *U = VMContext.getUndef(EltTy);
+    llvm::Value *U = llvm::UndefValue::get(EltTy);
     return RValue::getComplex(std::make_pair(U, U));
   } else if (hasAggregateLLVMType(Ty)) {
     const llvm::Type *LTy = llvm::PointerType::getUnqual(ConvertType(Ty));
-    return RValue::getAggregate(VMContext.getUndef(LTy));
+    return RValue::getAggregate(llvm::UndefValue::get(LTy));
   } else {
-    return RValue::get(VMContext.getUndef(ConvertType(Ty)));
+    return RValue::get(llvm::UndefValue::get(ConvertType(Ty)));
   }
 }
 
@@ -141,7 +141,7 @@
                                               const char *Name) {
   ErrorUnsupported(E, Name);
   llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType()));
-  return LValue::MakeAddr(VMContext.getUndef(Ty),
+  return LValue::MakeAddr(llvm::UndefValue::get(Ty),
                           E->getType().getCVRQualifiers(),
                           getContext().getObjCGCAttrKind(E->getType()),
                           E->getType().getAddressSpace());
@@ -412,7 +412,7 @@
   
   llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size());
   Vec = Builder.CreateShuffleVector(Vec,
-                                    VMContext.getUndef(Vec->getType()),
+                                    llvm::UndefValue::get(Vec->getType()),
                                     MaskV, "tmp");
   return RValue::get(Vec);
 }
@@ -617,7 +617,7 @@
     
       llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size());
       Vec = Builder.CreateShuffleVector(SrcVal,
-                                        VMContext.getUndef(Vec->getType()),
+                                        llvm::UndefValue::get(Vec->getType()),
                                         MaskV, "tmp");
     } else if (NumDstElts > NumSrcElts) {
       // Extended the source vector to the same length and then shuffle it
@@ -629,12 +629,12 @@
       for (i = 0; i != NumSrcElts; ++i)
         ExtMask.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, i));
       for (; i != NumDstElts; ++i)
-        ExtMask.push_back(VMContext.getUndef(llvm::Type::Int32Ty));
+        ExtMask.push_back(llvm::UndefValue::get(llvm::Type::Int32Ty));
       llvm::Value *ExtMaskV = llvm::ConstantVector::get(&ExtMask[0],
                                                         ExtMask.size());
       llvm::Value *ExtSrcVal = 
         Builder.CreateShuffleVector(SrcVal,
-                                    VMContext.getUndef(SrcVal->getType()),
+                                    llvm::UndefValue::get(SrcVal->getType()),
                                     ExtMaskV, "tmp");
       // build identity
       llvm::SmallVector<llvm::Constant*, 4> Mask;

Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=77638&r1=77637&r2=77638&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Thu Jul 30 18:11:26 2009
@@ -200,7 +200,7 @@
     const llvm::Type *ElementType = VType->getElementType();
 
     // Emit individual vector element stores.
-    llvm::Value *V = VMContext.getUndef(VType);
+    llvm::Value *V = llvm::UndefValue::get(VType);
     
     // Emit initializers
     unsigned i;
@@ -473,7 +473,7 @@
     llvm::Value *Elt = EmitScalarConversion(Src, SrcType, EltTy);
 
     // Insert the element in element zero of an undef vector
-    llvm::Value *UnV = VMContext.getUndef(DstTy);
+    llvm::Value *UnV = llvm::UndefValue::get(DstTy);
     llvm::Value *Idx = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0);
     UnV = Builder.CreateInsertElement(UnV, Elt, Idx, "tmp");
 
@@ -552,7 +552,7 @@
   CGF.ErrorUnsupported(E, "scalar expression");
   if (E->getType()->isVoidType())
     return 0;
-  return VMContext.getUndef(CGF.ConvertType(E->getType()));
+  return llvm::UndefValue::get(CGF.ConvertType(E->getType()));
 }
 
 Value *ScalarExprEmitter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
@@ -875,7 +875,7 @@
     // (Note that we do actually need the imaginary part of the RHS for
     // multiplication and division.)
     CGF.ErrorUnsupported(E, "complex compound assignment");
-    return VMContext.getUndef(CGF.ConvertType(E->getType()));
+    return llvm::UndefValue::get(CGF.ConvertType(E->getType()));
   }
 
   // Emit the RHS first.  __block variables need to have the rhs evaluated
@@ -1612,7 +1612,7 @@
 llvm::Value *CodeGenFunction::EmitVector(llvm::Value * const *Vals, 
                                          unsigned NumVals, bool isSplat) {
   llvm::Value *Vec
-    = VMContext.getUndef(llvm::VectorType::get(Vals[0]->getType(), NumVals));
+    = llvm::UndefValue::get(llvm::VectorType::get(Vals[0]->getType(), NumVals));
   
   for (unsigned i = 0, e = NumVals; i != e; ++i) {
     llvm::Value *Val = isSplat ? Vals[0] : Vals[i];

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=77638&r1=77637&r2=77638&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Thu Jul 30 18:11:26 2009
@@ -212,7 +212,7 @@
     
   Zeros[0] = llvm::ConstantInt::get(LongTy, 0);
   Zeros[1] = Zeros[0];
-  NULLPtr = VMContext.getConstantPointerNull(
+  NULLPtr = llvm::ConstantPointerNull::get(
     llvm::PointerType::getUnqual(llvm::Type::Int8Ty));
   // C string type.  Used in lots of places.
   PtrToInt8Ty = 
@@ -464,7 +464,7 @@
     if (isa<ObjCMethodDecl>(CGF.CurFuncDecl)) {
       self = CGF.LoadObjCSelf();
     } else {
-      self = VMContext.getConstantPointerNull(IdTy);
+      self = llvm::ConstantPointerNull::get(IdTy);
     }
     Params.push_back(self->getType());
     llvm::Constant *lookupFunction = 
@@ -538,7 +538,7 @@
   ObjCMethodListTy = llvm::cast<llvm::StructType>(OpaqueNextTy.get());
 
   Methods.clear();
-  Methods.push_back(VMContext.getConstantPointerNull(
+  Methods.push_back(llvm::ConstantPointerNull::get(
         llvm::PointerType::getUnqual(ObjCMethodListTy)));
   Methods.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty,
         MethodTypes.size()));
@@ -620,7 +620,7 @@
       NULL);
   llvm::Constant *Zero = llvm::ConstantInt::get(LongTy, 0);
   llvm::Constant *NullP =
-    VMContext.getConstantPointerNull(PtrTy);
+    llvm::ConstantPointerNull::get(PtrTy);
   // Fill in the structure
   std::vector<llvm::Constant*> Elements;
   Elements.push_back(llvm::ConstantExpr::getBitCast(MetaClass, PtrToInt8Ty));
@@ -966,7 +966,7 @@
   if (!SuperClassName.empty()) {
     SuperClass = MakeConstantString(SuperClassName, ".super_class_name");
   } else {
-    SuperClass = VMContext.getConstantPointerNull(PtrToInt8Ty);
+    SuperClass = llvm::ConstantPointerNull::get(PtrToInt8Ty);
   }
   // Empty vector used to construct empty method lists
   llvm::SmallVector<llvm::Constant*, 1>  empty;

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=77638&r1=77637&r2=77638&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu Jul 30 18:11:26 2009
@@ -156,7 +156,7 @@
   // Create a marker to make it easy to insert allocas into the entryblock
   // later.  Don't create this with the builder, because we don't want it
   // folded.
-  llvm::Value *Undef = VMContext.getUndef(llvm::Type::Int32Ty);
+  llvm::Value *Undef = llvm::UndefValue::get(llvm::Type::Int32Ty);
   AllocaInsertPt = new llvm::BitCastInst(Undef, llvm::Type::Int32Ty, "",
                                          EntryBB);
   if (Builder.isNamePreserving())

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=77638&r1=77637&r2=77638&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Jul 30 18:11:26 2009
@@ -808,7 +808,7 @@
     if (!Init) {
       ErrorUnsupported(D, "static initializer");
       QualType T = D->getInit()->getType();
-      Init = VMContext.getUndef(getTypes().ConvertType(T));
+      Init = llvm::UndefValue::get(getTypes().ConvertType(T));
     }
   }
 





More information about the cfe-commits mailing list