return true;
}
+ if (!self->blocks_count) {
+ asterror(ast_ctx(self), "function `%s` has no body", self->name);
+ return false;
+ }
+
self->curblock = ir_function_create_block(irf, "entry");
if (!self->curblock)
return false;
else
{
/* error("missing return"); */
+ asterror(ast_ctx(self), "function `%s` missing return value", self->name);
return false;
}
}
/* for a binstore we need both an lvalue and an rvalue for the left side */
/* rvalue of destination! */
cgen = self->dest->expression.codegen;
- if (!(*cgen)((ast_expression*)(self->dest), func, true, &leftr))
+ if (!(*cgen)((ast_expression*)(self->dest), func, false, &leftr))
return false;
/* source as rvalue only */
*out = ir_block_create_load_from_ent(func->curblock, ast_function_label(func, "efv"),
ent, field, self->expression.vtype);
}
- if (!*out)
+ if (!*out) {
+ asterror(ast_ctx(self), "failed to create %s instruction (output type %s)",
+ (lvalue ? "ADDRESS" : "FIELD"),
+ type_name[self->expression.vtype]);
return false;
+ }
if (lvalue)
self->expression.outl = *out;