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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/109438.diff


1 Files Affected:

- (modified) clang-tools-extra/clang-move/HelperDeclRefGraph.cpp (+2-2) 


``````````diff
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);

``````````

</details>


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


More information about the cfe-commits mailing list