[llvm] [Transforms] Use range-based for loops (NFC) (PR #97195)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 06:09:58 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) {
----------------
arsenm wrote:
I don't understand this warning. It sounds useless
https://github.com/llvm/llvm-project/pull/97195
More information about the llvm-commits
mailing list