]> granicus.if.org Git - llvm/commitdiff
Fix cppcheck shadow variable and variable scope warnings. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 31 Aug 2019 12:30:19 +0000 (12:30 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 31 Aug 2019 12:30:19 +0000 (12:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370580 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp

index 62a9c2ad45f19e746f46fe9c0e1bc395f81e84f2..dc0743cf4ada4b4c77bba4b8827f58e293d1f3cb 100644 (file)
@@ -1346,12 +1346,12 @@ private:
       if (ReuseShuffleIndices.empty())
         dbgs() << "Emtpy";
       else
-        for (unsigned Idx : ReuseShuffleIndices)
-          dbgs() << Idx << ", ";
+        for (unsigned ReuseIdx : ReuseShuffleIndices)
+          dbgs() << ReuseIdx << ", ";
       dbgs() << "\n";
       dbgs() << "ReorderIndices: ";
-      for (unsigned Idx : ReorderIndices)
-        dbgs() << Idx << ", ";
+      for (unsigned ReorderIdx : ReorderIndices)
+        dbgs() << ReorderIdx << ", ";
       dbgs() << "\n";
       dbgs() << "UserTreeIndices: ";
       for (const auto &EInfo : UserTreeIndices)
@@ -6579,10 +6579,9 @@ static bool findBuildVector(InsertElementInst *LastInsertElem,
 /// \return true if it matches.
 static bool findBuildAggregate(InsertValueInst *IV,
                                SmallVectorImpl<Value *> &BuildVectorOpds) {
-  Value *V;
   do {
     BuildVectorOpds.push_back(IV->getInsertedValueOperand());
-    V = IV->getAggregateOperand();
+    Value *V = IV->getAggregateOperand();
     if (isa<UndefValue>(V))
       break;
     IV = dyn_cast<InsertValueInst>(V);