diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-29 22:17:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-29 22:17:13 +0000 |
commit | debcb01b0f0a15f568ca69e8f288fade4bfc7297 (patch) | |
tree | 22a274838cf6c55205a8a3f0a80262b09b63b069 /lib/Transforms/IPO/GlobalOpt.cpp | |
parent | 37c4a2d6f15ff32c9ae91e333d655a349e195993 (diff) |
Move types back to the 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 5be3239a63..61e4316a61 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -826,7 +826,7 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, 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), @@ -1161,7 +1161,7 @@ static Value *GetHeapSROAValue(Value *V, unsigned FieldNo, 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 { @@ -1282,7 +1282,7 @@ static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, MallocInst *MI, 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(), @@ -1957,8 +1957,8 @@ static GlobalVariable *InstallGlobalCtors(GlobalVariable *GCL, 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); } |