Add a comment about DepthFirstIterator's skipchildren behavior
authorDaniel Berlin <dberlin@dberlin.org>
Fri, 8 May 2015 21:17:24 +0000 (21:17 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Fri, 8 May 2015 21:17:24 +0000 (21:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236904 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/DepthFirstIterator.h

index e9668c45d105dd2a3ceca3be938df2b092c37166..d79b9acacfa94b391e1ee33f6090e0eb4ad26760 100644 (file)
@@ -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())