Skip to content

Commit

Permalink
Rename Variable Ptr to PtrTy. NFC.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258130 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
manueljacob committed Jan 19, 2016
1 parent 7a02bc2 commit 95992a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/IR/ConstantFold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2040,11 +2040,11 @@ static Constant *ConstantFoldGetElementPtrImpl(Type *PointeeTy, Constant *C,
return C;

if (isa<UndefValue>(C)) {
PointerType *Ptr = cast<PointerType>(C->getType());
PointerType *PtrTy = cast<PointerType>(C->getType());
Type *Ty = GetElementPtrInst::getIndexedType(
cast<PointerType>(Ptr->getScalarType())->getElementType(), Idxs);
cast<PointerType>(PtrTy->getScalarType())->getElementType(), Idxs);
assert(Ty && "Invalid indices for GEP!");
return UndefValue::get(PointerType::get(Ty, Ptr->getAddressSpace()));
return UndefValue::get(PointerType::get(Ty, PtrTy->getAddressSpace()));
}

if (C->isNullValue()) {
Expand All @@ -2055,12 +2055,12 @@ static Constant *ConstantFoldGetElementPtrImpl(Type *PointeeTy, Constant *C,
break;
}
if (isNull) {
PointerType *Ptr = cast<PointerType>(C->getType());
PointerType *PtrTy = cast<PointerType>(C->getType());
Type *Ty = GetElementPtrInst::getIndexedType(
cast<PointerType>(Ptr->getScalarType())->getElementType(), Idxs);
cast<PointerType>(PtrTy->getScalarType())->getElementType(), Idxs);
assert(Ty && "Invalid indices for GEP!");
return ConstantPointerNull::get(PointerType::get(Ty,
Ptr->getAddressSpace()));
PtrTy->getAddressSpace()));
}
}

Expand Down

0 comments on commit 95992a2

Please sign in to comment.