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:
Geza Lore
2022-09-21 13:56:03 +01:00
parent 0a8cfb8d2c
commit ce03293128
70 changed files with 1386 additions and 1530 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ private:
iterateAndNextNull(nodep->condp());
m_inWhilep = nullptr;
startStatement(nodep);
iterateAndNextNull(nodep->bodysp());
iterateAndNextNull(nodep->stmtsp());
iterateAndNextNull(nodep->incsp());
m_stmtp = nullptr;
}
@@ -329,7 +329,7 @@ private:
}
void visit(AstNodeCond* nodep) override {
iterateChildren(nodep);
if (nodep->expr1p()->isWide() && !VN_IS(nodep->condp(), Const)
if (nodep->thenp()->isWide() && !VN_IS(nodep->condp(), Const)
&& !VN_IS(nodep->condp(), VarRef)) {
// We're going to need the expression several times in the expanded code,
// so might as well make it a common expression