From f1735d91b8a3b31fce6330bbe4c3dc43b55c3cd3 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 18 Nov 2012 20:36:02 +0100 Subject: [PATCH] remove a redundant ir_function member --- ast.c | 1 - ir.c | 9 ++++----- ir.h | 3 --- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ast.c b/ast.c index 3fc7353..9e59ca9 100644 --- a/ast.c +++ b/ast.c @@ -1247,7 +1247,6 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir) /* fill the parameter list */ ec = &self->vtype->expression; - irf->max_parameters = vec_size(ec->params); for (i = 0; i < vec_size(ec->params); ++i) { vec_push(irf->params, ec->params[i]->expression.vtype); diff --git a/ir.c b/ir.c index 025a96a..9907b35 100644 --- a/ir.c +++ b/ir.c @@ -432,8 +432,6 @@ ir_function* ir_function_new(ir_builder* owner, int outtype) self->values = NULL; self->locals = NULL; - self->max_parameters = 0; - self->code_function_def = -1; self->allocated_locals = 0; @@ -2761,18 +2759,19 @@ static void ir_gen_extparam(ir_builder *ir) static bool gen_function_extparam_copy(ir_function *self) { - size_t i, ext; + size_t i, ext, numparams; ir_builder *ir = self->owner; ir_value *ep; prog_section_statement stmt; - if (!self->max_parameters) + numparams = vec_size(self->params); + if (!numparams) return true; stmt.opcode = INSTR_STORE_F; stmt.o3.s1 = 0; - for (i = 8; i < self->max_parameters; ++i) { + for (i = 8; i < numparams; ++i) { ext = i - 8; if (ext >= vec_size(ir->extparams)) ir_gen_extparam(ir); diff --git a/ir.h b/ir.h index 00e2ddc..06efa5b 100644 --- a/ir.h +++ b/ir.h @@ -240,9 +240,6 @@ typedef struct ir_function_s /* locally defined variables */ ir_value **locals; - /* how many of the locals are parameters */ - size_t max_parameters; - size_t allocated_locals; ir_block* first; -- 2.39.2