[llvm] [Transforms] Use range-based for loops (NFC) (PR #97195)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 15:47:09 PDT 2024
================
@@ -226,9 +226,7 @@ static bool mergeConstants(Module &M) {
// Now that we have figured out which replacements must be made, do them all
// now. This avoid invalidating the pointers in CMap, which are unneeded
// now.
- for (unsigned i = 0, e = SameContentReplacements.size(); i != e; ++i) {
- GlobalVariable *Old = SameContentReplacements[i].first;
- GlobalVariable *New = SameContentReplacements[i].second;
+ for (const auto &[Old, New] : SameContentReplacements) {
----------------
dwblaikie wrote:
Probably designed to help catch cases of copying large structures. Two words seems a bit small to trigger such a warning. I think I've pushed back on this elsewhere too.
It doesn't look like this is a clang warning? ( https://godbolt.org/z/sKfKsYj8b ) - perhaps it's some clang-tidy diagnosed issue?
Where'd you see this warning, @kazutakahirata ?
https://github.com/llvm/llvm-project/pull/97195
More information about the llvm-commits
mailing list