From b4e30b31e9d8e43c3bede8d199f8bedf820be212 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Wed, 2 Apr 2014 19:28:08 +0000 Subject: [PATCH] Make some range based loop types more explicit. No functional change, but more readable code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205451 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM64/ARM64AddressTypePromotion.cpp | 4 ++-- lib/Target/ARM64/ARM64CollectLOH.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Target/ARM64/ARM64AddressTypePromotion.cpp b/lib/Target/ARM64/ARM64AddressTypePromotion.cpp index 0bba95ead90..72fa6af367c 100644 --- a/lib/Target/ARM64/ARM64AddressTypePromotion.cpp +++ b/lib/Target/ARM64/ARM64AddressTypePromotion.cpp @@ -371,7 +371,7 @@ ARM64AddressTypePromotion::propagateSignExtension(Instructions &SExtInsts) { mergeSExts(ValToSExtendedUses, ToRemove); // Remove all instructions marked as ToRemove. - for (auto I: ToRemove) + for (Instruction *I: ToRemove) I->eraseFromParent(); return LocalChange; } @@ -383,7 +383,7 @@ void ARM64AddressTypePromotion::mergeSExts(ValueToInsts &ValToSExtendedUses, for (auto &Entry: ValToSExtendedUses) { Instructions &Insts = Entry.second; Instructions CurPts; - for (auto Inst : Insts) { + for (Instruction *Inst : Insts) { if (ToRemove.count(Inst)) continue; bool inserted = false; diff --git a/lib/Target/ARM64/ARM64CollectLOH.cpp b/lib/Target/ARM64/ARM64CollectLOH.cpp index d4b0ccc198f..f52778f2b2c 100644 --- a/lib/Target/ARM64/ARM64CollectLOH.cpp +++ b/lib/Target/ARM64/ARM64CollectLOH.cpp @@ -420,7 +420,7 @@ static void reachingDefAlgorithm(MachineFunction *MF, BBInSet.insert(PredOutSet.begin(), PredOutSet.end()); } // insert reachableUses[bb][color] in each in[bb][color] op.reachedses - for (const auto MI: BBInSet) { + for (const MachineInstr *MI: BBInSet) { SetOfMachineInstr &OpReachedUses = getUses(ColorOpToReachedUses, CurReg, MI); OpReachedUses.insert(BBReachableUses.begin(), BBReachableUses.end()); @@ -635,7 +635,7 @@ static void reachedUsesToDefs(InstrToInstrs &UseToReachingDefs, } } } - for (const auto Elem : NotCandidate) { + for (const MachineInstr *Elem : NotCandidate) { DEBUG(dbgs() << "Too many reaching defs: " << *Elem << "\n"); // It would have been better if we could just remove the entry // from the map. Because of that, we have to filter the garbage @@ -916,7 +916,7 @@ static void computeOthers(const InstrToInstrs &UseToDefs, if (DefsOfPotentialCandidates.empty()) { // lazy init DefsOfPotentialCandidates = PotentialCandidates; - for (const auto Candidate : PotentialCandidates) { + for (const MachineInstr *Candidate : PotentialCandidates) { if (!UseToDefs.find(Candidate)->second.empty()) DefsOfPotentialCandidates.insert( *UseToDefs.find(Candidate)->second.begin()); @@ -1030,7 +1030,7 @@ static void computeOthers(const InstrToInstrs &UseToDefs, } // Now, we grabbed all the big patterns, check ADR opportunities. - for (const auto Candidate: PotentialADROpportunities) + for (const MachineInstr *Candidate: PotentialADROpportunities) registerADRCandidate(Candidate, UseToDefs, DefsPerColorToUses, ARM64FI, InvolvedInLOHs, RegToId); } -- 2.11.0