From 54b3f9295103a48acee5d2d72024c820834c41c3 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 28 Nov 2017 18:21:43 -0500 Subject: [PATCH] Commentary --- src/V3Ast.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/V3Ast.h b/src/V3Ast.h index 3ba7cd3ce..f9edcd5ae 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -881,14 +881,18 @@ public: class AstNVisitor { private: - vector m_deleteps; // Nodes to delete when we are finished + vector m_deleteps; // Nodes to delete when doDeletes() called protected: friend class AstNode; public: - // Cleaning + /// At the end of the visitor (or doDeletes()), delete this pushed node + /// along with all children and next(s). This is often better to use + /// than an immediate deleteTree, as any pointers into this node will + /// persist for the lifetime of the visitor void pushDeletep(AstNode* nodep) { m_deleteps.push_back(nodep); } + /// Call deleteTree on all previously pushDeletep()'ed nodes void doDeletes(); public: virtual ~AstNVisitor() {