From 235dfcf70abca65dba5d80f1a42d1485bab8980c Mon Sep 17 00:00:00 2001 From: River Riddle Date: Sat, 31 Oct 2020 14:21:49 -0700 Subject: [PATCH] [mlir][AsmPrinter] Fix crash in windows build after D89354 Switch to an index based loop instead of using enumerate. --- mlir/lib/IR/AsmPrinter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index 790b50c..beb05ad 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -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}}); } } -- 2.7.4