mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 03:26:05 +00:00
Change LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&.
The array passed to LoadAndStorePromoter's constructor was a constant reference to a SmallVectorImpl, which is just the same as passing an ArrayRef. Also, the data in the array can be 'const Instruction*' instead of 'Instruction*'. Its not possible to convert a SmallVectorImpl<T*> to SmallVectorImpl<const T*>, but ArrayRef does provide such a method. Currently this added calls to makeArrayRef which should be a nop, but i'm going to kick off a discussion about improving ArrayRef to not need these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237226 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1088,7 +1088,8 @@ class AllocaPromoter : public LoadAndStorePromoter {
|
||||
SmallVector<DbgValueInst *, 4> DVIs;
|
||||
|
||||
public:
|
||||
AllocaPromoter(const SmallVectorImpl<Instruction *> &Insts, SSAUpdater &S,
|
||||
AllocaPromoter(ArrayRef<const Instruction *> Insts,
|
||||
SSAUpdater &S,
|
||||
AllocaInst &AI, DIBuilder &DIB)
|
||||
: LoadAndStorePromoter(Insts, S), AI(AI), DIB(DIB) {}
|
||||
|
||||
@@ -4418,7 +4419,7 @@ bool SROA::promoteAllocas(Function &F) {
|
||||
DeadInsts.push_back(I);
|
||||
enqueueUsersInWorklist(*I, Worklist, Visited);
|
||||
}
|
||||
AllocaPromoter(Insts, SSA, *AI, DIB).run(Insts);
|
||||
AllocaPromoter(makeArrayRef(Insts), SSA, *AI, DIB).run(Insts);
|
||||
while (!DeadInsts.empty())
|
||||
DeadInsts.pop_back_val()->eraseFromParent();
|
||||
AI->eraseFromParent();
|
||||
|
Reference in New Issue
Block a user