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())