Update for LLVM API changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77638 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 8367c27..3e9a273 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -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;