Go to the previous, next section.

Destination of the Results

It is necessary to provide the destination of the created SUIF code when calling a make_..() function. When a destination is given, all the types and symbols will be installed in the correct symbol tables. Otherwise, appending the SUIF structures created in a different scope can take some variable and types out of their valid scope, creating inconsistent SUIF. The destination can be given by passing an optional parameter giving the block_symtab of the next scope. The destination can also be specified by providing the SUIF structure that will become the parent of the structure generated. This parent structure can be an instruction, a tree_node or a tree_node_list.

        tree_node * tn = ..
        var_sym * vs = ..
        block code(block(vs) = block(0));
        tree_node * init_tn = code.make_tree_node(tn->parent());
        tn->parent()->append_after(init_tn, tn->list_e());

Note that if any variable used in the builder structure is not in the scope of the destination, a new variable will be created, which may not be intentional. Refer to the section on Cloning in the SUIF reference manual for more details.

Go to the previous, next section.