[llvm] 66dab2f - [NFC] Fix compiler warnings

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 11:03:57 PST 2021


Author: Quentin Colombet
Date: 2021-03-10T11:03:50-08:00
New Revision: 66dab2fa8470eb8ff4c3e975ddd8bc05c0766a22

URL: https://github.com/llvm/llvm-project/commit/66dab2fa8470eb8ff4c3e975ddd8bc05c0766a22
DIFF: https://github.com/llvm/llvm-project/commit/66dab2fa8470eb8ff4c3e975ddd8bc05c0766a22.diff

LOG: [NFC] Fix compiler warnings

Fix warnings caused by -Wrange-loop-analysis.

Patch by Xiaoqing Wu <xiaoqing_wu at apple.com>

Differential Revision: https://reviews.llvm.org/D98298

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
index 5f6e62ed2545..1bd22af3e135 100644
--- a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
+++ b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
@@ -44,7 +44,7 @@ struct WasmEHFuncInfo {
     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 @@ struct WasmEHFuncInfo {
     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;
   }

diff  --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 09bcba27f7c5..cc931df5c75c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -345,7 +345,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
     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 *>()]);
     }


        


More information about the llvm-commits mailing list