localopt stuff for const-code irg
[libfirm] / ir / be / scripts / generate_regalloc_if.pl
index f111b47..f892e3d 100755 (executable)
@@ -22,7 +22,6 @@
 # This script generates C code which creates ands sets up functions and
 # data structures for the register allocator.
 # Creation: 2005/11/14
-# $Id$
 
 use strict;
 use Data::Dumper;
@@ -207,6 +206,10 @@ EOF
 
                $regdef  .= "\tREG_${ucname},\n";
                $regdef2 .= "\tREG_${classuc}_${ucname} = $idx,\n";
+               my $dwarf_number = 0;
+               if (defined($_->{dwarf})) {
+                       $dwarf_number = $_->{dwarf};
+               }
 
                $regtypes_def .= <<EOF;
        {
@@ -215,7 +218,8 @@ EOF
                REG_${classuc}_${ucname},
                REG_${ucname},
                ${type},
-               &${arch}_single_reg_req_${old_classname}_${name}
+               &${arch}_single_reg_req_${old_classname}_${name},
+               ${dwarf_number}
        },
 EOF
 
@@ -311,7 +315,6 @@ print OUT<<EOF;
 #include "config.h"
 
 #include "gen_${arch}_regalloc_if.h"
-#include "gen_${arch}_machine.h"
 #include "bearch_${arch}_t.h"
 #include "irmode.h"
 
@@ -336,33 +339,3 @@ ${reginit}
 }
 EOF
 close(OUT);
-
-###
-# Gets the variable name for the execution unit assigned to this register.
-###
-sub get_execunit_variable_name {
-       my $unit    = shift;
-       my $name    = "NULL";
-       my $uc_arch = uc($arch);
-
-       if ($unit) {
-               my $found = 0;
-SRCH:  foreach my $cur_type (keys(%cpu)) {
-                       foreach my $cur_unit (@{ $cpu{"$cur_type"} }) {
-                               if ($unit eq $cur_unit) {
-                                       my $tp_name   = "$arch\_execution_units_$cur_type";
-                                       my $unit_name = "$uc_arch\_EXECUNIT_TP_$cur_type\_$unit";
-                                       $name  = "&".$tp_name."[".$unit_name."]";
-                                       $found = 1;
-                                       last SRCH;
-                               }
-                       }
-               }
-
-               if (! $found) {
-                       print STDERR "Invalid execution unit $unit specified!\n";
-               }
-       }
-
-       return $name;
-}