[PATCH] D98298: Fix compiler warnings

Xiaoqing Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 15:13:31 PST 2021


xiaoqing_wu created this revision.
xiaoqing_wu added reviewers: aheejin, qcolombet.
Herald added subscribers: hiraditya, sbc100.
xiaoqing_wu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fix warnings caused by -Wrange-loop-analysis.


https://reviews.llvm.org/D98298

Files:
  llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
  llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp


Index: llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -345,7 +345,7 @@
     for (auto &KV : EHInfo.UnwindDestToSrcs) {
       const auto *Dest = KV.first.get<const BasicBlock *>();
       UnwindDestToSrcs[MBBMap[Dest]] = SmallPtrSet<BBOrMBB, 4>();
-      for (const auto &P : KV.second)
+      for (const auto P : KV.second)
         UnwindDestToSrcs[MBBMap[Dest]].insert(
             MBBMap[P.get<const BasicBlock *>()]);
     }
Index: llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
===================================================================
--- llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
+++ llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
@@ -44,7 +44,7 @@
     assert(hasUnwindSrcs(BB));
     const auto &Set = UnwindDestToSrcs.lookup(BB);
     SmallPtrSet<const BasicBlock *, 4> Ret;
-    for (const auto &P : Set)
+    for (const auto P : Set)
       Ret.insert(P.get<const BasicBlock *>());
     return Ret;
   }
@@ -70,7 +70,7 @@
     assert(hasUnwindSrcs(MBB));
     const auto &Set = UnwindDestToSrcs.lookup(MBB);
     SmallPtrSet<MachineBasicBlock *, 4> Ret;
-    for (const auto &P : Set)
+    for (const auto P : Set)
       Ret.insert(P.get<MachineBasicBlock *>());
     return Ret;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98298.329483.patch
Type: text/x-patch
Size: 1400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210309/a10466b4/attachment.bin>


More information about the llvm-commits mailing list