[llvm] [llvm] Use range-based for loops (NFC) (PR #146945)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 12:57:07 PDT 2025


================
@@ -95,8 +95,8 @@ bool M68kInstrInfo::AnalyzeBranchImpl(MachineBasicBlock &MBB,
   // Erase any instructions if allowed at the end of the scope.
   std::vector<std::reference_wrapper<llvm::MachineInstr>> EraseList;
   auto FinalizeOnReturn = llvm::make_scope_exit([&EraseList] {
-    std::for_each(EraseList.begin(), EraseList.end(),
-                  [](auto &ref) { ref.get().eraseFromParent(); });
+    for (auto &ref : EraseList)
----------------
mshockwave wrote:

could we use this opportunity to rename it into `Ref`?

https://github.com/llvm/llvm-project/pull/146945


More information about the llvm-commits mailing list