From c67979bf4d301654e3863d0e3adc3f6a3d5bba29 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 llvm-svn: 236904 --- llvm/include/llvm/ADT/DepthFirstIterator.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ADT/DepthFirstIterator.h b/llvm/include/llvm/ADT/DepthFirstIterator.h index e9668c45d105..d79b9acacfa9 100644 --- a/llvm/include/llvm/ADT/DepthFirstIterator.h +++ b/llvm/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())