b->file = NULL;
b->line = -1;
b->col = -1;
- exec_list_make_empty(&b->functions);
+ list_inithead(&b->functions);
b->entry_point_stage = stage;
b->entry_point_name = entry_point_name;
b->options = dup_options;
bool progress;
do {
progress = false;
- foreach_list_typed(struct vtn_function, func, node, &b->functions) {
+ vtn_foreach_cf_node(node, &b->functions) {
+ struct vtn_function *func = vtn_cf_node_as_function(node);
if (func->referenced && !func->emitted) {
b->const_table = _mesa_pointer_hash_table_create(b);
vtn_assert(b->func == NULL);
b->func = rzalloc(b, struct vtn_function);
+ b->func->node.type = vtn_cf_node_type_function;
list_inithead(&b->func->body);
b->func->control = w[3];
* implemented functions that we'll walk later.
*/
b->func->start_block = b->block;
- exec_list_push_tail(&b->functions, &b->func->node);
+ list_addtail(&b->func->node.link, &b->functions);
}
break;
}
vtn_foreach_instruction(b, words, end,
vtn_cfg_handle_prepass_instruction);
- foreach_list_typed(struct vtn_function, func, node, &b->functions) {
+ vtn_foreach_cf_node(node, &b->functions) {
+ struct vtn_function *func = vtn_cf_node_as_function(node);
vtn_cfg_walk_blocks(b, &func->body, func->start_block,
NULL, NULL, NULL, NULL, NULL);
}
vtn_cf_node_type_loop,
vtn_cf_node_type_case,
vtn_cf_node_type_switch,
+ vtn_cf_node_type_function,
};
struct vtn_cf_node {
};
struct vtn_function {
- struct exec_node node;
+ struct vtn_cf_node node;
struct vtn_type *type;
VTN_DECL_CF_NODE_CAST(if)
VTN_DECL_CF_NODE_CAST(case)
VTN_DECL_CF_NODE_CAST(switch)
+VTN_DECL_CF_NODE_CAST(function)
#define vtn_foreach_cf_node(node, cf_list) \
list_for_each_entry(struct vtn_cf_node, node, cf_list, link)
bool variable_pointers;
struct vtn_function *func;
- struct exec_list functions;
+ struct list_head functions;
/* Current function parameter index */
unsigned func_param_idx;