if (NElements->getZExtValue() != 1) {
// If we have an array allocation, transform it to a single element
// allocation to make the code below simpler.
- Type *NewTy = Context.getArrayType(MI->getAllocatedType(),
+ Type *NewTy = ArrayType::get(MI->getAllocatedType(),
NElements->getZExtValue());
MallocInst *NewMI =
new MallocInst(NewTy, Context.getNullValue(Type::Int32Ty),
cast<StructType>(cast<PointerType>(PN->getType())->getElementType());
Result =
- PHINode::Create(Context.getPointerTypeUnqual(ST->getElementType(FieldNo)),
+ PHINode::Create(PointerType::getUnqual(ST->getElementType(FieldNo)),
PN->getName()+".f"+utostr(FieldNo), PN);
PHIsToRewrite.push_back(std::make_pair(PN, FieldNo));
} else {
for (unsigned FieldNo = 0, e = STy->getNumElements(); FieldNo != e;++FieldNo){
const Type *FieldTy = STy->getElementType(FieldNo);
- const Type *PFieldTy = Context.getPointerTypeUnqual(FieldTy);
+ const Type *PFieldTy = PointerType::getUnqual(FieldTy);
GlobalVariable *NGV =
new GlobalVariable(*GV->getParent(),
if (Ctors[i]) {
CSVals[1] = Ctors[i];
} else {
- const Type *FTy = Context.getFunctionType(Type::VoidTy, false);
- const PointerType *PFTy = Context.getPointerTypeUnqual(FTy);
+ const Type *FTy = FunctionType::get(Type::VoidTy, false);
+ const PointerType *PFTy = PointerType::getUnqual(FTy);
CSVals[1] = Context.getNullValue(PFTy);
CSVals[0] = ConstantInt::get(Type::Int32Ty, 2147483647);
}