From 2a9757bf38ce9fcdc7523513eb0e6b805b550820 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Tue, 18 Aug 2026 11:19:27 +0200 Subject: [PATCH] Internals: Make AstCLocalScope an AstNodeStmt (#6280) (#8140) AstCLocalScope wraps statements in an unnamed C++ scope ('{ ... }') and is only ever placed in statement position. Part of #6280. --- src/V3AstNodeOther.h | 10 ---------- src/V3AstNodeStmt.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/V3AstNodeOther.h b/src/V3AstNodeOther.h index a2f8f8fd5..02db326c4 100644 --- a/src/V3AstNodeOther.h +++ b/src/V3AstNodeOther.h @@ -662,16 +662,6 @@ public: && !dpiImportPrototype(); } }; -class AstCLocalScope final : public AstNode { - // Pack statements into an unnamed scope when generating C++ - // @astgen op1 := stmtsp : List[AstNode] -public: - AstCLocalScope(FileLine* fl, AstNode* stmtsp) - : ASTGEN_SUPER_CLocalScope(fl) { - addStmtsp(stmtsp); - } - ASTGEN_MEMBERS_AstCLocalScope; -}; class AstCUse final : public AstNode { // C++ use of a class or #include; indicates need of forward declaration // Parents: NODEMODULE diff --git a/src/V3AstNodeStmt.h b/src/V3AstNodeStmt.h index 6f016a185..50f7e738b 100644 --- a/src/V3AstNodeStmt.h +++ b/src/V3AstNodeStmt.h @@ -297,6 +297,16 @@ public: AstSenTree* sentreep() const { return m_sentreep; } void clearSentreep() { m_sentreep = nullptr; } }; +class AstCLocalScope final : public AstNodeStmt { + // Pack statements into an unnamed scope when generating C++ + // @astgen op1 := stmtsp : List[AstNode] +public: + AstCLocalScope(FileLine* fl, AstNode* stmtsp) + : ASTGEN_SUPER_CLocalScope(fl) { + addStmtsp(stmtsp); + } + ASTGEN_MEMBERS_AstCLocalScope; +}; class AstCReturn final : public AstNodeStmt { // C++ return from a function // @astgen op1 := lhsp : AstNodeExpr