[mlir][AsmPrinter] Fix crash in windows build after D89354
authorRiver Riddle <riddleriver@gmail.com>
Sat, 31 Oct 2020 21:21:49 +0000 (14:21 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Sat, 31 Oct 2020 21:21:49 +0000 (14:21 -0700)
Switch to an index based loop instead of using enumerate.

mlir/lib/IR/AsmPrinter.cpp

index 790b50c..beb05ad 100644 (file)
@@ -376,8 +376,8 @@ static void initializeAliases(
       continue;
     }
     // Otherwise, add the index to the name.
-    for (auto &symbolIt : llvm::enumerate(it.second))
-      symbolToAlias.insert({symbolIt.value(), {it.first, symbolIt.index()}});
+    for (int i = 0, e = it.second.size(); i < e; ++i)
+      symbolToAlias.insert({it.second[i], {it.first, i}});
   }
 }