mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Generate AstNode accessors via astgen
Introduce the @astgen directives parsed by astgen, currently used for the generation child node (operand) accessors. Please see the updated internal documentation for details.
This commit is contained in:
@@ -170,7 +170,7 @@ private:
|
||||
|
||||
UINFO(8, "ifsp:\n");
|
||||
m_instrCount = 0;
|
||||
iterateAndNextNull(nodep->ifsp());
|
||||
iterateAndNextNull(nodep->thensp());
|
||||
uint32_t ifCount = m_instrCount;
|
||||
if (nodep->branchPred().unlikely()) ifCount = 0;
|
||||
|
||||
@@ -185,7 +185,7 @@ private:
|
||||
if (nodep->elsesp()) nodep->elsesp()->user4(0); // Don't dump it
|
||||
} else {
|
||||
m_instrCount = savedCount + elseCount;
|
||||
if (nodep->ifsp()) nodep->ifsp()->user4(0); // Don't dump it
|
||||
if (nodep->thensp()) nodep->thensp()->user4(0); // Don't dump it
|
||||
}
|
||||
}
|
||||
void visit(AstNodeCond* nodep) override {
|
||||
@@ -197,20 +197,20 @@ private:
|
||||
|
||||
UINFO(8, "?\n");
|
||||
m_instrCount = 0;
|
||||
iterateAndNextNull(nodep->expr1p());
|
||||
iterateAndNextNull(nodep->thenp());
|
||||
const uint32_t ifCount = m_instrCount;
|
||||
|
||||
UINFO(8, ":\n");
|
||||
m_instrCount = 0;
|
||||
iterateAndNextNull(nodep->expr2p());
|
||||
iterateAndNextNull(nodep->elsep());
|
||||
const uint32_t elseCount = m_instrCount;
|
||||
|
||||
if (ifCount < elseCount) {
|
||||
m_instrCount = savedCount + elseCount;
|
||||
if (nodep->expr1p()) nodep->expr1p()->user4(0); // Don't dump it
|
||||
if (nodep->thenp()) nodep->thenp()->user4(0); // Don't dump it
|
||||
} else {
|
||||
m_instrCount = savedCount + ifCount;
|
||||
if (nodep->expr2p()) nodep->expr2p()->user4(0); // Don't dump it
|
||||
if (nodep->elsep()) nodep->elsep()->user4(0); // Don't dump it
|
||||
}
|
||||
}
|
||||
void visit(AstActive* nodep) override {
|
||||
|
||||
Reference in New Issue
Block a user