ir_function stores max_varargs now

This commit is contained in:
Wolfgang Bumiller 2013-01-12 14:01:16 +01:00
parent 1861660585
commit 2a4ea74a97
3 changed files with 6 additions and 0 deletions

1
ast.c
View file

@ -1582,6 +1582,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
if (self->varargs) {
if (!ast_local_codegen(self->varargs, self->ir_func, true))
return false;
irf->max_varargs = self->varargs->expression.count;
}
if (self->builtin) {

2
ir.c
View file

@ -485,6 +485,8 @@ ir_function* ir_function_new(ir_builder* owner, int outtype)
self->values = NULL;
self->locals = NULL;
self->max_varargs = NULL;
self->code_function_def = -1;
self->allocated_locals = 0;
self->globaltemps = 0;

3
ir.h
View file

@ -273,6 +273,9 @@ typedef struct ir_function_s
size_t run_id;
struct ir_builder_s *owner;
/* vararg support: */
size_t max_varargs;
} ir_function;
#define IR_FLAG_HAS_ARRAYS (1<<1)
#define IR_FLAG_HAS_UNINITIALIZED (1<<2)