yosys/frontends/ast
Martin Povišer 22b99413e8 ast/simplify: Make in_lvalue/in_param into props of AST nodes
Instead of passing around in_lvalue/in_param flags to simplify, we make
the flags into properties of the AST nodes themselves. After the tree
is first parsed, we once do

  ast->fixup_hierarchy_flags(true)

to walk the full hierarchy and set the flags to their initial correct
values. Then as long as one is using ->clone(), ->cloneInto() and the
AstNode constructor (with children passed to it) to modify the tree, the
flags will be kept in sync automatically. On the other hand if we are
modifying the children list of an existing node, we may need to call

  node->fixup_hierarchy_flags()

to do a localized fixup. That fixup will update the flags on the node's
children, and will propagate the change down the tree if necessary.

clone() doesn't always retain the flags of the subtree being cloned. It
will produce a tree with a consistent setting of the flags, but the
root doesn't have in_param/in_lvalue set unless it's intrinsic to the
type of node being cloned (e.g. AST_PARAMETER). cloneInto() will make
sure the cloned subtree has the flags consistent with the new placement
in a hierarchy.

Add asserts to make sure the old and new way of determining the flags
agree.
2023-09-26 13:32:15 +02:00
..
Makefile.inc Generate an RTLIL representation of bind constructs 2021-08-13 17:11:35 -06:00
ast.cc ast/simplify: Make in_lvalue/in_param into props of AST nodes 2023-09-26 13:32:15 +02:00
ast.h ast/simplify: Make in_lvalue/in_param into props of AST nodes 2023-09-26 13:32:15 +02:00
ast_binding.cc Generate an RTLIL representation of bind constructs 2021-08-13 17:11:35 -06:00
ast_binding.h Generate an RTLIL representation of bind constructs 2021-08-13 17:11:35 -06:00
dpicall.cc Fixing old e-mail addresses and deadnames 2021-06-08 00:39:36 +02:00
genrtlil.cc ast/simplify: Make in_lvalue/in_param into props of AST nodes 2023-09-26 13:32:15 +02:00
simplify.cc ast/simplify: Make in_lvalue/in_param into props of AST nodes 2023-09-26 13:32:15 +02:00