This avoids unneeded copies when using a range-based for loops.
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Paths
| Differential D70870
[IR] Use a reference in a range-based for ClosedPublic Authored by Mordante on Nov 30 2019, 12:06 PM.
Details Summary This avoids unneeded copies when using a range-based for loops. This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Diff Detail
Event Timelinefhahn added inline comments.
This revision is now accepted and ready to land.Dec 17 2019, 4:30 AM Closed by commit rG1a8ff89653d2: [IR] Use a reference in a range-based for (authored by Mordante). · Explain WhyDec 17 2019, 12:59 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 234373 llvm/lib/IR/Attributes.cpp
llvm/lib/IR/ModuleSummaryIndex.cpp
|
It might help a bit more with readability of the code (here and other places in the patch) if you expand the type instead of auto, if the type is not too long (https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable)