From c45f60ae7b8fe118934d17e0fcddda03e14f7256 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sat, 24 May 2008 16:35:45 +0000 Subject: [PATCH] allocate all op attributes on block instead of a lot of malloc calls [r19749] --- ir/be/scripts/generate_new_opcodes.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ir/be/scripts/generate_new_opcodes.pl b/ir/be/scripts/generate_new_opcodes.pl index b691e7992..85e26270e 100755 --- a/ir/be/scripts/generate_new_opcodes.pl +++ b/ir/be/scripts/generate_new_opcodes.pl @@ -586,8 +586,7 @@ foreach my $op (keys(%nodes)) { push(@obst_new_irop, $temp); push(@obst_new_irop, "\tset_op_tag(op_$op, $arch\_op_tag);\n"); if(defined($default_op_attr_type)) { - push(@obst_new_irop, "\tattr = ($default_op_attr_type *) xmalloc(sizeof(attr[0]));\n"); - push(@obst_new_irop, "\tmemset(attr, 0, sizeof(attr[0]));\n"); + push(@obst_new_irop, "\tattr = &attrs[iro_$op];\n"); if(defined($n{op_attr_init})) { push(@obst_new_irop, "\t".$n{op_attr_init}."\n"); } @@ -717,8 +716,8 @@ void $arch\_create_opcodes(const arch_irn_ops_t *be_ops) { int i; ENDOFMAIN - if(defined($default_op_attr_type)) { - print OUT "\t$default_op_attr_type *attr;\n"; + if (defined($default_op_attr_type)) { + print OUT "\t$default_op_attr_type *attr, *attrs;\n"; } print OUT<