From 4f6cfa6408330763342990125d6b3d729b874ffb Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 1 Dec 2012 21:52:42 +0100 Subject: [PATCH] bescripts: Remove support for emit templates. --- ir/be/scripts/generate_emitter.pl | 44 +------------------------------ 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/ir/be/scripts/generate_emitter.pl b/ir/be/scripts/generate_emitter.pl index 008ad0cfd..26d785c47 100755 --- a/ir/be/scripts/generate_emitter.pl +++ b/ir/be/scripts/generate_emitter.pl @@ -31,8 +31,6 @@ our $target_dir = $ARGV[1]; our $arch; our %nodes; -our %emit_templates; -our $finish_line_template = "be_emit_finish_line_gas(node);"; my $return; @@ -52,40 +50,6 @@ my @obst_func; # stack for the emit functions my @obst_register; # stack for emitter register code my $line; -sub create_emitter { - my $result = shift; - my $indent = shift; - my $template = shift; - our %emit_templates; - our $arch; - - $template = "\\t" . $template; - - my @tokens = ($template =~ m/(?:[^%]|%%)+|\%[a-zA-Z_][a-zA-Z0-9_]*|%\./g); - for (@tokens) { - SWITCH: { - if (/%\./) { last SWITCH; } - if (/^%([^%]+)/) { - if(defined($emit_templates{$1})) { - push(@{$result}, "${indent}$emit_templates{$1}\n"); - } else { - print "Warning: No emit_template defined for '$1'\n"; - push(@{$result}, "${indent}$1(node);\n"); - } - last SWITCH; - } - $_ =~ s/%%/%/g; - if (length($_) == 1) { - push(@{$result}, "${indent}be_emit_char('$_');\n"); - } else { - push(@{$result}, "${indent}be_emit_cstring(\"$_\");\n"); - } - } - } - push(@{$result}, "${indent}${finish_line_template}\n"); -} - - foreach my $op (keys(%nodes)) { my %n = %{ $nodes{"$op"} }; @@ -111,13 +75,7 @@ foreach my $op (keys(%nodes)) { my @emit = split(/\n/, $n{"emit"}); foreach my $template (@emit) { - # substitute only lines, starting with a '.' - if ($template eq '') { - # nothing - } elsif ($template =~ /^(\s*)\.\s*(.*)/) { - my $indent = "\t$1"; - create_emitter(\@obst_func, $indent, $2); - } else { + if ($template ne '') { push(@obst_func, "\t${arch}_emitf(node, \"$template\");\n"); } } -- 2.20.1