break;
case TYPE_FUNCTION:
/* unlink us from the function node */
- self->constval.vfunc->vtype = nullptr;
+ self->constval.vfunc->function_type = nullptr;
break;
/* NOTE: delete function? currently collected in
* the parser structure
goto cleanup;
}
- self->vtype = vtype;
- self->name = name ? util_strdup(name) : nullptr;
+ self->function_type = vtype;
+ self->name = name ? util_strdup(name) : nullptr;
self->labelcount = 0;
self->builtin = 0;
{
if (self->name)
mem_d((void*)self->name);
- if (self->vtype) {
- /* ast_value_delete(self->vtype); */
- self->vtype->hasvalue = false;
- self->vtype->constval.vfunc = nullptr;
+ if (self->function_type) {
+ /* ast_value_delete(self->function_type); */
+ self->function_type->hasvalue = false;
+ self->function_type->constval.vfunc = nullptr;
/* We use unref - if it was stored in a global table it is supposed
* to be deleted from *there*
*/
- ast_unref(self->vtype);
+ ast_unref(self->function_type);
}
for (auto &it : self->static_names)
mem_d(it);
}
/* fill the parameter list */
- ec = &self->vtype->expression;
+ ec = &self->function_type->expression;
for (auto &it : ec->params) {
if (it->expression.vtype == TYPE_FIELD)
vec_push(irf->params, it->expression.next->vtype);
/* TODO: check return types */
if (!self->curblock->final)
{
- if (!self->vtype->expression.next ||
- self->vtype->expression.next->vtype == TYPE_VOID)
+ if (!self->function_type->expression.next ||
+ self->function_type->expression.next->vtype == TYPE_VOID)
{
return ir_block_create_return(self->curblock, ast_ctx(self), nullptr);
}