Mercurial > hg > CbC > CbC_xv6
changeset 342:1a63c120f2ba
fix
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 27 Feb 2020 15:54:33 +0900 |
parents | 97e3acfa9fba |
children | a9aba14b2b6a |
files | src/gearsTools/trans_impl.pl |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gearsTools/trans_impl.pl Mon Feb 24 16:15:52 2020 +0900 +++ b/src/gearsTools/trans_impl.pl Thu Feb 27 15:54:33 2020 +0900 @@ -30,7 +30,6 @@ my $interface = {ir => $inter_ir, var_name => $interface_var_name}; my $impl = {ir => $impl_ir, var_name => $impl_var_name}; - my $output_file = $impl_file; $output_file =~ s/\.h/.cbc/; my $stdout = *STDOUT; @@ -77,7 +76,7 @@ my ($out, $impl, $interface) = @_; my $impl_ir = $impl->{ir}; - my $inter_ir = $impl->{ir}; + my $inter_ir = $interface->{ir}; my $impl_var_name = $impl->{var_name}; my $interface_var_name = $interface->{var_name}; @@ -120,7 +119,7 @@ for my $code (@{$impl_ir->{codes}}) { my $code_gear = $code->{name}; next if $code_gear eq 'next'; - print $out " ${impl_var_name}->$code_gear = C_$code_gear$impl_ir->{name};\n" + print $out " ${impl_var_name}->$code_gear = C_$code_gear;\n" } for my $code (@{$inter_ir->{codes}}) { @@ -173,7 +172,11 @@ } else { $data_gears =~ s/Impl/struct $impl/g; } - print $out "__code $cg->{name}$impl("; + print $out "__code $cg->{name}"; + unless ($is_impl) { + print $out "$impl"; + } + print "("; print $out "$data_gears) {\n\n"; _emit_cg($out,$data_gears); }