mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +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:
@ -674,8 +674,9 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
|
||||
for (ScalarizeTable::iterator SI = ArgIndices.begin(),
|
||||
E = ArgIndices.end(); SI != E; ++SI) {
|
||||
// not allowed to dereference ->begin() if size() is 0
|
||||
Params.push_back(
|
||||
GetElementPtrInst::getIndexedType(I->getType(), SI->second));
|
||||
Params.push_back(GetElementPtrInst::getIndexedType(
|
||||
cast<PointerType>(I->getType()->getScalarType())->getElementType(),
|
||||
SI->second));
|
||||
assert(Params.back());
|
||||
}
|
||||
|
||||
|
@ -611,8 +611,10 @@ static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI,
|
||||
return false;
|
||||
|
||||
SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx);
|
||||
Type *AllocTy =
|
||||
GetElementPtrInst::getIndexedType(GEPI->getOperand(0)->getType(), Ops);
|
||||
Type *AllocTy = GetElementPtrInst::getIndexedType(
|
||||
cast<PointerType>(GEPI->getOperand(0)->getType()->getScalarType())
|
||||
->getElementType(),
|
||||
Ops);
|
||||
if (!AllocTy || !AllocTy->isSized())
|
||||
return false;
|
||||
const DataLayout &DL = IC.getDataLayout();
|
||||
|
Reference in New Issue
Block a user