mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Convert GetElementPtrInst to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -576,9 +576,7 @@ 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->begin(),
|
||||
SI->end()));
|
||||
Params.push_back(GetElementPtrInst::getIndexedType(I->getType(), *SI));
|
||||
assert(Params.back());
|
||||
}
|
||||
|
||||
@@ -668,7 +666,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
|
||||
ConstantInt::get(Type::getInt32Ty(F->getContext()), 0), 0 };
|
||||
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
|
||||
Idxs[1] = ConstantInt::get(Type::getInt32Ty(F->getContext()), i);
|
||||
Value *Idx = GetElementPtrInst::Create(*AI, Idxs, Idxs+2,
|
||||
Value *Idx = GetElementPtrInst::Create(*AI, Idxs,
|
||||
(*AI)->getName()+"."+utostr(i),
|
||||
Call);
|
||||
// TODO: Tell AA about the new values?
|
||||
@@ -699,8 +697,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
|
||||
ElTy = cast<CompositeType>(ElTy)->getTypeAtIndex(*II);
|
||||
}
|
||||
// And create a GEP to extract those indices.
|
||||
V = GetElementPtrInst::Create(V, Ops.begin(), Ops.end(),
|
||||
V->getName()+".idx", Call);
|
||||
V = GetElementPtrInst::Create(V, Ops, V->getName()+".idx", Call);
|
||||
Ops.clear();
|
||||
AA.copyValue(OrigLoad->getOperand(0), V);
|
||||
}
|
||||
@@ -801,7 +798,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
|
||||
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
|
||||
Idxs[1] = ConstantInt::get(Type::getInt32Ty(F->getContext()), i);
|
||||
Value *Idx =
|
||||
GetElementPtrInst::Create(TheAlloca, Idxs, Idxs+2,
|
||||
GetElementPtrInst::Create(TheAlloca, Idxs,
|
||||
TheAlloca->getName()+"."+Twine(i),
|
||||
InsertPt);
|
||||
I2->setName(I->getName()+"."+Twine(i));
|
||||
|
Reference in New Issue
Block a user