From 344a3780b2e33f6ca763666c380202b18aab72a3 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 29 Jul 2021 22:15:26 +0200 Subject: Vendor import of llvm-project main 88e66fa60ae5, the last commit before the upstream release/13.x branch was created. --- llvm/lib/CodeGen/StackSlotColoring.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'llvm/lib/CodeGen/StackSlotColoring.cpp') diff --git a/llvm/lib/CodeGen/StackSlotColoring.cpp b/llvm/lib/CodeGen/StackSlotColoring.cpp index a6f8974f3343..ebe00bd7402f 100644 --- a/llvm/lib/CodeGen/StackSlotColoring.cpp +++ b/llvm/lib/CodeGen/StackSlotColoring.cpp @@ -76,7 +76,7 @@ namespace { // OrigAlignments - Alignments of stack objects before coloring. SmallVector OrigAlignments; - // OrigSizes - Sizess of stack objects before coloring. + // OrigSizes - Sizes of stack objects before coloring. SmallVector OrigSizes; // AllColors - If index is set, it's a spill slot, i.e. color. @@ -157,12 +157,8 @@ void StackSlotColoring::ScanForSpillSlotRefs(MachineFunction &MF) { SSRefs.resize(MFI->getObjectIndexEnd()); // FIXME: Need the equivalent of MachineRegisterInfo for frameindex operands. - for (MachineFunction::iterator MBBI = MF.begin(), E = MF.end(); - MBBI != E; ++MBBI) { - MachineBasicBlock *MBB = &*MBBI; - for (MachineBasicBlock::iterator MII = MBB->begin(), EE = MBB->end(); - MII != EE; ++MII) { - MachineInstr &MI = *MII; + for (MachineBasicBlock &MBB : MF) { + for (MachineInstr &MI : MBB) { for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { MachineOperand &MO = MI.getOperand(i); if (!MO.isFI()) @@ -474,9 +470,8 @@ bool StackSlotColoring::RemoveDeadStores(MachineBasicBlock* MBB) { ++I; } - for (SmallVectorImpl::iterator I = toErase.begin(), - E = toErase.end(); I != E; ++I) - (*I)->eraseFromParent(); + for (MachineInstr *MI : toErase) + MI->eraseFromParent(); return changed; } -- cgit v1.2.3