Skip to content

Commit f80b630

Browse files
committed
[mlir][PDL] Use explicit loop over llvm::find to fix MSVC breakage
1 parent a65d8c5 commit f80b630

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mlir/lib/Rewrite/ByteCode.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,10 @@ class ByteCodeExecutor {
769769

770770
// Check to see if the attribute value is within the case list. Jump to
771771
// the correct successor index based on the result.
772-
auto it = llvm::find(cases, value);
773-
selectJump(it == cases.end() ? size_t(0) : ((it - cases.begin()) + 1));
772+
for (auto it = cases.begin(), e = cases.end(); it != e; ++it)
773+
if (*it == value)
774+
return selectJump(size_t((it - cases.begin()) + 1));
775+
selectJump(size_t(0));
774776
}
775777

776778
/// Internal implementation of reading various data types from the bytecode

0 commit comments

Comments
 (0)