[llvm] r236904 - Add a comment about DepthFirstIterator's skipchildren behavior

Daniel Berlin dberlin at dberlin.org
Fri May 8 14:17:25 PDT 2015


Author: dannyb
Date: Fri May  8 16:17:24 2015
New Revision: 236904

URL: http://llvm.org/viewvc/llvm-project?rev=236904&view=rev
Log:
Add a comment about DepthFirstIterator's skipchildren behavior

Modified:
    llvm/trunk/include/llvm/ADT/DepthFirstIterator.h

Modified: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DepthFirstIterator.h?rev=236904&r1=236903&r2=236904&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DepthFirstIterator.h (original)
+++ llvm/trunk/include/llvm/ADT/DepthFirstIterator.h Fri May  8 16:17:24 2015
@@ -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())





More information about the llvm-commits mailing list