From abe9ecd2253a890b46efdf2546786f7142abc55c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 21 Jul 2012 07:28:39 -0400 Subject: [PATCH] Internals: Move AstBegin code below GenFor. No functional change. --- src/V3AstNodes.h | 70 ++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 6c24f72f4..c2bc2db07 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -1244,41 +1244,6 @@ public: //###################################################################### -struct AstBegin : public AstNode { - // A Begin/end named block, only exists shortly after parsing until linking - // Parents: statement - // Children: statements -private: - string m_name; // Name of block - bool m_unnamed; // Originally unnamed - bool m_hidden; // Inserted by verilator, not user - bool m_generate; // Underneath a generate -public: - // Node that simply puts name into the output stream - AstBegin(FileLine* fileline, const string& name, AstNode* stmtsp, bool generate=false) - : AstNode(fileline) - , m_name(name) { - addNOp1p(stmtsp); - m_unnamed = (name==""); - m_hidden = false; - m_generate = generate; - } - ASTNODE_NODE_FUNCS(Begin, BEGIN) - virtual void dump(ostream& str); - virtual string name() const { return m_name; } // * = Block name - virtual void name(const string& name) { m_name = name; } - // op1 = Statements - AstNode* stmtsp() const { return op1p()->castNode(); } // op1 = List of statements - void addStmtsp(AstNode* nodep) { addNOp1p(nodep); } - AstNode* flatsp() const { return op2p()->castNode(); } // op2 = Statements that don't appear under new scope - void addFlatsp(AstNode* nodep) { addNOp2p(nodep); } - bool unnamed() const { return m_unnamed; } - void hidden(bool flag) { m_hidden = flag; } - bool hidden() const { return m_hidden; } - void generate(bool flag) { m_generate = flag; } - bool generate() const { return m_generate; } -}; - struct AstGenerate : public AstNode { // A Generate/end block // Parents: MODULE @@ -2372,6 +2337,41 @@ public: virtual bool same(AstNode* samep) const { return true; } }; +struct AstBegin : public AstNode { + // A Begin/end named block, only exists shortly after parsing until linking + // Parents: statement + // Children: statements +private: + string m_name; // Name of block + bool m_unnamed; // Originally unnamed + bool m_hidden; // Inserted by verilator, not user + bool m_generate; // Underneath a generate +public: + // Node that simply puts name into the output stream + AstBegin(FileLine* fileline, const string& name, AstNode* stmtsp, bool generate=false) + : AstNode(fileline) + , m_name(name) { + addNOp1p(stmtsp); + m_unnamed = (name==""); + m_hidden = false; + m_generate = generate; + } + ASTNODE_NODE_FUNCS(Begin, BEGIN) + virtual void dump(ostream& str); + virtual string name() const { return m_name; } // * = Block name + virtual void name(const string& name) { m_name = name; } + // op1 = Statements + AstNode* stmtsp() const { return op1p()->castNode(); } // op1 = List of statements + void addStmtsp(AstNode* nodep) { addNOp1p(nodep); } + AstNode* flatsp() const { return op2p()->castNode(); } // op2 = Statements that don't appear under new scope + void addFlatsp(AstNode* nodep) { addNOp2p(nodep); } + bool unnamed() const { return m_unnamed; } + void hidden(bool flag) { m_hidden = flag; } + bool hidden() const { return m_hidden; } + void generate(bool flag) { m_generate = flag; } + bool generate() const { return m_generate; } +}; + struct AstInitial : public AstNode { AstInitial(FileLine* fl, AstNode* bodysp) : AstNode(fl) {