Go to the previous, next section.
block out of a SUIF structure, unless
specified otherwise, a clone of the SUIF structure is created. The
builder can be instructed not to clone by setting an optional
duplicate argument to FALSE.
When a builder structure is created without cloning, the first use of
that block will receive the original SUIF structure. Subsequent
uses will get a cloned copy.
Thus, the following code will generate correct results.
tree_node_list * tnl = ...
block body(tnl, FALSE);
block code(block::IF(cond, body, body));
But the next example will generate INCORRECT SUIF since the same
SUIF structure is illegally reused. This is a problem since SUIF
structures generally exist in a larger data structure and contain parent
pointers. Thus a SUIF structure can not exist in two places at once.
tree_node_list * tnl = ...
block code(block::IF(cond, block(tnl, FALSE), block(tnl, FALSE)));
Go to the previous, next section.