Skip to content

Commit b7ebb67

Browse files
committed
[SCEV] Fix -Wrange-loop-construct (NFC)
/llvm-project/llvm/lib/Analysis/ScalarEvolution.cpp:12009:21: error: loop variable '[S, Mul]' creates a copy from type 'const value_type' (aka 'const llvm::detail::DenseMapPair<const llvm::SCEV *, int>') [-Werror,-Wrange-loop-construct] for (const auto [S, Mul] : Multiplicity) { ^ /llvm-project/llvm/lib/Analysis/ScalarEvolution.cpp:12009:10: note: use reference type 'const value_type &' (aka 'const llvm::detail::DenseMapPair<const llvm::SCEV *, int> &') to prevent copying for (const auto [S, Mul] : Multiplicity) { ^~~~~~~~~~~~~~~~~~~~~ &
1 parent e0ad56b commit b7ebb67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12006,7 +12006,7 @@ ScalarEvolution::computeConstantDifference(const SCEV *More, const SCEV *Less) {
1200612006
// Check whether all the non-constants cancel out, or reduce to new
1200712007
// More/Less values.
1200812008
const SCEV *NewMore = nullptr, *NewLess = nullptr;
12009-
for (const auto [S, Mul] : Multiplicity) {
12009+
for (const auto &[S, Mul] : Multiplicity) {
1201012010
if (Mul == 0)
1201112011
continue;
1201212012
if (Mul == 1) {

0 commit comments

Comments
 (0)