self->node.context = ctx;
self->node.destroy = &_ast_node_destroy;
self->node.keep = false;
+ self->node.uses = 0;
self->node.nodetype = nodetype;
}
else
self->expression.vtype = left->expression.vtype;
+ ast_use(left);
+ ast_use(right);
+
return self;
}
else
self->expression.next = NULL;
+ ast_use(left);
+ ast_use(right);
+ ast_use(left);
+
return self;
}
self->op = op;
self->operand = expr;
+ ast_use(expr);
+
return self;
}
self->operand = expr;
+ ast_use(expr);
+
return self;
}
self->entity = entity;
self->field = field;
+ ast_use(entity);
+ ast_use(field);
+
return self;
}
self->owner = owner;
self->field = field;
+ ast_use(owner);
+
return self;
}
self->on_true = ontrue;
self->on_false = onfalse;
+ ast_use(cond);
+ if (ontrue) ast_use(ontrue);
+ if (onfalse) ast_use(onfalse);
+
return self;
}
self->on_false = onfalse;
self->phi_out = NULL;
+ ast_use(cond);
+ ast_use(ontrue);
+ ast_use(onfalse);
+
return self;
}
self->increment = increment;
self->body = body;
+ if (initexpr) ast_use(initexpr);
+ if (precond) ast_use(precond);
+ if (postcond) ast_use(postcond);
+ if (increment) ast_use(increment);
+ if (body) ast_use(body);
+
return self;
}
MEM_VECTOR_INIT(self, params);
self->func = funcexpr;
+ ast_use(funcexpr);
return self;
}
MEM_VEC_FUNCTIONS(ast_call, ast_expression*, params)
+bool ast_call_add_param(ast_call *self, ast_expression *expr)
+{
+ if (!ast_call_params_add(self, expr))
+ return false;
+ ast_use(expr);
+ return true;
+}
+
void ast_call_delete(ast_call *self)
{
size_t i;
self->dest = dest;
self->source = source;
+ ast_use(dest);
+ ast_use(source);
+
return self;
}
MEM_VEC_FUNCTIONS(ast_block, ast_value*, locals)
MEM_VEC_FUNCTIONS(ast_block, ast_expression*, exprs)
+bool ast_block_add_expr(ast_block *self, ast_expression *expr)
+{
+ if (!ast_block_exprs_add(self, expr))
+ return false;
+ ast_use(expr);
+ return true;
+}
+
void ast_block_delete(ast_block *self)
{
size_t i;