remove a redundant ir_function member
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 18 Nov 2012 19:36:02 +0000 (20:36 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 18 Nov 2012 19:36:02 +0000 (20:36 +0100)
ast.c
ir.c
ir.h

diff --git a/ast.c b/ast.c
index 3fc7353206e80c690c9d4021aab20d4270b7e9a2..9e59ca917d73c9ed561b10f33bcf8087f01b3c28 100644 (file)
--- 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 025a96ad1a4a820b93fe88e5165d55a68ec6fa63..9907b3585284a5770961786259003a608ecc9e73 100644 (file)
--- 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 00e2ddc0382229d5d60f58a12bbafe6388e81b5d..06efa5b21600264a8c29399f37a94ead961b8030 100644 (file)
--- 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;