From fd5c9868cb303e661ea1a13d4d8afb264808e8f5 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Fri, 8 May 2015 21:17:24 +0000 Subject: [PATCH] Add a comment about DepthFirstIterator's skipchildren behavior git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236904 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/DepthFirstIterator.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/llvm/ADT/DepthFirstIterator.h b/include/llvm/ADT/DepthFirstIterator.h index e9668c45d10..d79b9acacfa 100644 --- a/include/llvm/ADT/DepthFirstIterator.h +++ b/include/llvm/ADT/DepthFirstIterator.h @@ -159,8 +159,10 @@ public: return *this; } - // skips all children of the current node and traverses to next node - // + /// \brief Skips all children of the current node and traverses to next node + /// + /// Note: This function takes care of incrementing the iterator. If you + /// always increment and call this function, you risk walking off the end. df_iterator &skipChildren() { VisitStack.pop_back(); if (!VisitStack.empty()) -- 2.34.1