Make some range based loop types more explicit.
authorJim Grosbach <grosbach@apple.com>
Wed, 2 Apr 2014 19:28:08 +0000 (19:28 +0000)
committerJim Grosbach <grosbach@apple.com>
Wed, 2 Apr 2014 19:28:08 +0000 (19:28 +0000)
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
lib/Target/ARM64/ARM64CollectLOH.cpp

index 0bba95ead90294869f01b320041fe8bb4a3c9dd7..72fa6af367cf153f500b933e89e9eb81bc5d4a5e 100644 (file)
@@ -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;
index d4b0ccc198ffe517ec6074887e005798bc8d63f5..f52778f2b2ca90fa9f10133d43f6fa6a9ca1e3a6 100644 (file)
@@ -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);
 }