# HG changeset patch # User Takahiro SHIMIZU # Date 1542098683 -32400 # Node ID a5f4b3f1c5d16606e5a96bfd85a42f8de9cc756d # Parent 1bec35c665bd34d54d876edd64378487b137053e fix right curly brackets indents and use i for GET_REG diff -r 1bec35c665bd -r a5f4b3f1c5d1 cbctools/change_OP_to_cbc.pl --- a/cbctools/change_OP_to_cbc.pl Sun Nov 04 21:09:28 2018 +0900 +++ b/cbctools/change_OP_to_cbc.pl Tue Nov 13 17:44:43 2018 +0900 @@ -16,6 +16,15 @@ my @upside = (); for (;$i < scalar(@cbc_lines); $i++){ + + $cbc_lines[$i] = change_i($cbc_lines[$i]); + + #$cbc_lines[$i] =~ s/reg_base/i->reg_base/g; + #$cbc_lines[$i] =~ s/tc/i->tc/g; + #$cbc_lines[$i] =~ s/tc/i->tc/g; + + $cbc_lines[$i] =~ s/GET_(REG|LEX)\((.*?)\)/GET_$1($2,i)/g; + push @upside,$cbc_lines[$i]; if ($cbc_lines[$i+1] =~ /\/\* This is the interpreter run loop. We have one of these per thread. \*\//){ last; @@ -76,6 +85,11 @@ } # 普通の行は変換してinsertする + if ($cbc_lines[$i] =~ /}/){ + if ($cbc_lines[$i+1] =~ /OP/){ + $cbc_lines[$i] = "}\n"; + } + } push @rewritec,change_i($cbc_lines[$i]); @@ -93,6 +107,7 @@ sub change_i { my $str = shift; + $str =~ s/^op/i->op/g; $str =~ s/cur_op/i->cur_op/g; $str =~ s/tc/i->tc/g; $str =~ s/cur_callsite/i->cur_callsite/g;