diff options
| author | Fangrui Song <maskray@google.com> | 2020-01-01 15:55:14 -0800 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2020-01-01 16:06:04 -0800 |
| commit | eeef50b1fee91dbe993187324003d2665ceae331 (patch) | |
| tree | 15f68eb8fac2485d6624d4962f011dc8d64bce73 /mlir/lib/Parser | |
| parent | 681b1be774964a804beabfb7c5e3bdab8f979e4a (diff) | |
| download | bcm5719-llvm-eeef50b1fee91dbe993187324003d2665ceae331.tar.gz bcm5719-llvm-eeef50b1fee91dbe993187324003d2665ceae331.zip | |
[mlir] Fix -Wrange-loo-analysis warnings
for (const auto &x : llvm::zip(..., ...))
->
for (auto x : llvm::zip(..., ...))
The return type of zip() is a wrapper that wraps a tuple of references.
> warning: loop variable 'p' is always a copy because the range of type 'detail::zippy<detail::zip_shortest, ArrayRef<long> &, ArrayRef<long> &>' does not return a reference [-Wrange-loop-analysis]
Diffstat (limited to 'mlir/lib/Parser')
| -rw-r--r-- | mlir/lib/Parser/Parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp index 0198a45172b..942a93e5897 100644 --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -3766,7 +3766,7 @@ Operation *OperationParser::parseGenericOperation() { } // Add the successors, and their operands after the proper operands. - for (const auto &succ : llvm::zip(successors, successorOperands)) { + for (auto succ : llvm::zip(successors, successorOperands)) { Block *successor = std::get<0>(succ); const SmallVector<Value, 4> &operands = std::get<1>(succ); result.addSuccessor(successor, operands); @@ -4176,7 +4176,7 @@ public: SmallVector<std::pair<OperationParser::SSAUseInfo, Type>, 2> regionArguments; - for (const auto &pair : llvm::zip(arguments, argTypes)) { + for (auto pair : llvm::zip(arguments, argTypes)) { const OperandType &operand = std::get<0>(pair); Type type = std::get<1>(pair); OperationParser::SSAUseInfo operandInfo = {operand.name, operand.number, |

