From 3cc120a51e7329a713850f96e613247c8289d389 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 28 Jul 2009 21:22:35 +0000 Subject: [PATCH] Update for LLVM API change. llvm-svn: 77368 --- clang/lib/CodeGen/CGExpr.cpp | 12 ++++++------ clang/lib/CodeGen/CGExprConstant.cpp | 4 ++-- clang/lib/CodeGen/CGExprScalar.cpp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index ab0f9e9..3a37f2d 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -410,7 +410,7 @@ RValue CodeGenFunction::EmitLoadOfExtVectorElementLValue(LValue LV, Mask.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, InIdx)); } - llvm::Value *MaskV = VMContext.getConstantVector(&Mask[0], Mask.size()); + llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size()); Vec = Builder.CreateShuffleVector(Vec, VMContext.getUndef(Vec->getType()), MaskV, "tmp"); @@ -615,7 +615,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, Mask[InIdx] = llvm::ConstantInt::get(llvm::Type::Int32Ty, i); } - llvm::Value *MaskV = VMContext.getConstantVector(&Mask[0], Mask.size()); + llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size()); Vec = Builder.CreateShuffleVector(SrcVal, VMContext.getUndef(Vec->getType()), MaskV, "tmp"); @@ -631,7 +631,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, ExtMask.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, i)); for (; i != NumDstElts; ++i) ExtMask.push_back(VMContext.getUndef(llvm::Type::Int32Ty)); - llvm::Value *ExtMaskV = VMContext.getConstantVector(&ExtMask[0], + llvm::Value *ExtMaskV = llvm::ConstantVector::get(&ExtMask[0], ExtMask.size()); llvm::Value *ExtSrcVal = Builder.CreateShuffleVector(SrcVal, @@ -647,7 +647,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, unsigned Idx = getAccessedFieldNo(i, Elts); Mask[Idx] = llvm::ConstantInt::get(llvm::Type::Int32Ty, i+NumDstElts); } - llvm::Value *MaskV = VMContext.getConstantVector(&Mask[0], Mask.size()); + llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size()); Vec = Builder.CreateShuffleVector(Vec, ExtSrcVal, MaskV, "tmp"); } else { @@ -932,7 +932,7 @@ llvm::Constant *GenerateConstantVector(llvm::LLVMContext &VMContext, for (unsigned i = 0, e = Elts.size(); i != e; ++i) CElts.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, Elts[i])); - return VMContext.getConstantVector(&CElts[0], CElts.size()); + return llvm::ConstantVector::get(&CElts[0], CElts.size()); } LValue CodeGenFunction:: @@ -972,7 +972,7 @@ EmitExtVectorElementExpr(const ExtVectorElementExpr *E) { else CElts.push_back(BaseElts->getOperand(Indices[i])); } - llvm::Constant *CV = VMContext.getConstantVector(&CElts[0], CElts.size()); + llvm::Constant *CV = llvm::ConstantVector::get(&CElts[0], CElts.size()); return LValue::MakeExtVectorElt(Base.getExtVectorAddr(), CV, Base.getQualifiers()); } diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 9976677..55361f8 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -646,7 +646,7 @@ public: for (; i < NumElements; ++i) Elts.push_back(VMContext.getNullValue(ElemTy)); - return VMContext.getConstantVector(VType, Elts); + return llvm::ConstantVector::get(VType, Elts); } llvm::Constant *VisitImplicitValueInitExpr(ImplicitValueInitExpr* E) { @@ -901,7 +901,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E, else Inits.push_back(llvm::ConstantFP::get(VMContext, Elt.getFloat())); } - return VMContext.getConstantVector(&Inits[0], Inits.size()); + return llvm::ConstantVector::get(&Inits[0], Inits.size()); } } } diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 141d393..cbca7aa 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -476,7 +476,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType, for (unsigned i = 0; i < NumElements; i++) Args.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, 0)); - llvm::Constant *Mask = VMContext.getConstantVector(&Args[0], NumElements); + llvm::Constant *Mask = llvm::ConstantVector::get(&Args[0], NumElements); llvm::Value *Yay = Builder.CreateShuffleVector(UnV, UnV, Mask, "splat"); return Yay; } @@ -555,7 +555,7 @@ Value *ScalarExprEmitter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) { } Value* V1 = CGF.EmitScalarExpr(E->getExpr(0)); Value* V2 = CGF.EmitScalarExpr(E->getExpr(1)); - Value* SV = VMContext.getConstantVector(indices.begin(), indices.size()); + Value* SV = llvm::ConstantVector::get(indices.begin(), indices.size()); return Builder.CreateShuffleVector(V1, V2, SV, "shuffle"); } @@ -1599,7 +1599,7 @@ Value *CodeGenFunction::EmitShuffleVector(Value* V1, Value *V2, ...) { const char *Name = va_arg(va, const char *); va_end(va); - llvm::Constant *Mask = VMContext.getConstantVector(&Args[0], NumElements); + llvm::Constant *Mask = llvm::ConstantVector::get(&Args[0], NumElements); return Builder.CreateShuffleVector(V1, V2, Mask, Name); } -- 2.7.4