[clang-tools-extra] [clang-move] Use a range-based for loop (NFC) (PR #109438)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 08:40:21 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/109438

None

>From a8f5541213f25f266355db26cb685d969cdf6ef9 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 20 Sep 2024 08:36:08 -0700
Subject: [PATCH] [clang-move] Use a range-based for loop (NFC)

---
 clang-tools-extra/clang-move/HelperDeclRefGraph.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp b/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp
index ae7dc5b2c0548b..36fddcba25d616 100644
--- a/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp
+++ b/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp
@@ -78,8 +78,8 @@ HelperDeclRefGraph::getReachableNodes(const Decl *Root) const {
       [&](const CallGraphNode *Node) {
         if (!ConnectedNodes.insert(Node).second)
           return;
-        for (auto It = Node->begin(), End = Node->end(); It != End; ++It)
-          VisitNode(*It);
+        for (const CallGraphNode::CallRecord &Callee : *Node)
+          VisitNode(Callee);
       };
 
   VisitNode(RootNode);



More information about the cfe-commits mailing list