mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type
This pushes the use of PointerType::getElementType up into several callers - I'll essentially just have to keep pushing that up the stack until I can eliminate every call to it... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2031,7 +2031,8 @@ static Constant *ConstantFoldGetElementPtrImpl(Constant *C,
|
||||
|
||||
if (isa<UndefValue>(C)) {
|
||||
PointerType *Ptr = cast<PointerType>(C->getType());
|
||||
Type *Ty = GetElementPtrInst::getIndexedType(Ptr, Idxs);
|
||||
Type *Ty = GetElementPtrInst::getIndexedType(
|
||||
cast<PointerType>(Ptr->getScalarType())->getElementType(), Idxs);
|
||||
assert(Ty && "Invalid indices for GEP!");
|
||||
return UndefValue::get(PointerType::get(Ty, Ptr->getAddressSpace()));
|
||||
}
|
||||
@ -2045,7 +2046,8 @@ static Constant *ConstantFoldGetElementPtrImpl(Constant *C,
|
||||
}
|
||||
if (isNull) {
|
||||
PointerType *Ptr = cast<PointerType>(C->getType());
|
||||
Type *Ty = GetElementPtrInst::getIndexedType(Ptr, Idxs);
|
||||
Type *Ty = GetElementPtrInst::getIndexedType(
|
||||
cast<PointerType>(Ptr->getScalarType())->getElementType(), Idxs);
|
||||
assert(Ty && "Invalid indices for GEP!");
|
||||
return ConstantPointerNull::get(PointerType::get(Ty,
|
||||
Ptr->getAddressSpace()));
|
||||
|
Reference in New Issue
Block a user