[opaque pointer type] gep API migration

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2015-03-14 21:20:51 +00:00
parent 67dcb7d7ca
commit e265afc254

View File

@ -255,6 +255,7 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
Value *BasePtr = GetPointerOperand(MemI); Value *BasePtr = GetPointerOperand(MemI);
assert(BasePtr && "No pointer operand"); assert(BasePtr && "No pointer operand");
Type *I8Ty = Type::getInt8Ty(MemI->getParent()->getContext());
Type *I8PtrTy = Type::getInt8PtrTy(MemI->getParent()->getContext(), Type *I8PtrTy = Type::getInt8PtrTy(MemI->getParent()->getContext(),
BasePtr->getType()->getPointerAddressSpace()); BasePtr->getType()->getPointerAddressSpace());
@ -289,8 +290,8 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
} }
Instruction *InsPoint = Header->getFirstInsertionPt(); Instruction *InsPoint = Header->getFirstInsertionPt();
GetElementPtrInst *PtrInc = GetElementPtrInst *PtrInc = GetElementPtrInst::Create(
GetElementPtrInst::Create(NewPHI, BasePtrIncSCEV->getValue(), I8Ty, NewPHI, BasePtrIncSCEV->getValue(),
MemI->hasName() ? MemI->getName() + ".inc" : "", InsPoint); MemI->hasName() ? MemI->getName() + ".inc" : "", InsPoint);
PtrInc->setIsInBounds(IsPtrInBounds(BasePtr)); PtrInc->setIsInBounds(IsPtrInBounds(BasePtr));
for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header); for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
@ -336,8 +337,8 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
else if (!PtrIP) else if (!PtrIP)
PtrIP = I->second; PtrIP = I->second;
GetElementPtrInst *NewPtr = GetElementPtrInst *NewPtr = GetElementPtrInst::Create(
GetElementPtrInst::Create(PtrInc, Diff->getValue(), I8Ty, PtrInc, Diff->getValue(),
I->second->hasName() ? I->second->getName() + ".off" : "", PtrIP); I->second->hasName() ? I->second->getName() + ".off" : "", PtrIP);
if (!PtrIP) if (!PtrIP)
NewPtr->insertAfter(cast<Instruction>(PtrInc)); NewPtr->insertAfter(cast<Instruction>(PtrInc));