my $specfile = $ARGV[0];
my $target_dir = $ARGV[1];
-my $target_c = $target_dir."/emitter_gen.c";
-my $target_h = $target_dir."/emitter_gen.h";
-
our $arch;
our %nodes;
}
use strict "subs";
+my $target_c = $target_dir."/gen_".$arch."_emitter.c";
+my $target_h = $target_dir."/gen_".$arch."_emitter.h";
+
# stacks for output
my @obst_func; # stack for the emit functions
my @obst_header; # stack for the function prototypes
}
else {
$regkind = ($2 eq "s" ? "source" : "dest");
- push(@params, "get_".$regkind."_reg(n, $3)");
+ push(@params, "get_".$regkind."_reg_name(n, $3)");
}
s/%$1/%%\%s/;
}
my $creation_time = localtime(time());
+my $tmp = uc($arch);
+
print OUT<<EOF;
-#ifndef _EMITTER_GEN_H_
-#define _EMITTER_GEN_H_
+#ifndef _GEN_$tmp\_EMITTER_H_
+#define _GEN_$tmp\_EMITTER_H_
/**
* Function prototypes for the emitter functions.
print OUT @obst_header;
-print OUT "#endif /* _EMITTER_GEN_H_ */\n";
+print OUT "#endif /* _GEN_$tmp\_EMITTER_H_ */\n";
close(OUT);
#include <stdio.h>
#include "irnode.h"
-#include "emitter_gen.h"
-#include "emitter.h"
+#include "gen_$arch\_emitter.h"
+#include "$arch\_emitter.h"
+#include "$arch\_new_nodes.h"
EOF