This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Replace OP stubs in mathoms.c with #define aliases in opcode.h
[perl5.git] / regen / opcode.pl
index bd3d55a..5b7aee7 100755 (executable)
@@ -107,7 +107,14 @@ my @raw_alias = (
                 Perl_pp_rv2av => ['rv2hv'],
                 Perl_pp_akeys => ['avalues'],
                 Perl_pp_rkeys => [qw(rvalues reach)],
-                Perl_pp_trans => [qw(trans transr)],
+                Perl_pp_trans => ['transr'],
+                Perl_pp_chop => ['chomp'],
+                Perl_pp_schop => ['schomp'],
+                Perl_pp_bind => ['connect'],
+                Perl_pp_preinc => ['i_preinc'],
+                Perl_pp_predec => ['i_predec'],
+                Perl_pp_postinc => ['i_postinc'],
+                Perl_pp_postdec => ['i_postdec'],
                );
 
 while (my ($func, $names) = splice @raw_alias, 0, 2) {
@@ -136,10 +143,13 @@ print <<"END";
 
 #ifndef PERL_GLOBAL_STRUCT_INIT
 
-#define Perl_pp_i_preinc Perl_pp_preinc
-#define Perl_pp_i_predec Perl_pp_predec
-#define Perl_pp_i_postinc Perl_pp_postinc
-#define Perl_pp_i_postdec Perl_pp_postdec
+END
+
+for (@ops) {
+    print "#define Perl_pp_$_ $alias{$_}\n" if $alias{$_};
+}
+
+print <<'END';
 
 PERL_PPDEF(Perl_unimplemented_op)
 
@@ -173,8 +183,6 @@ for (@ops) {
 print $on "\t", &tab(3,"OP_max"), "\n";
 print $on "} opcode;\n";
 print $on "\n#define MAXO ", scalar @ops, "\n";
-print $on "#define OP_phoney_INPUT_ONLY -1\n";
-print $on "#define OP_phoney_OUTPUT_ONLY -2\n\n";
 
 # Emit op names and descriptions.
 
@@ -1049,7 +1057,7 @@ hintseval eval hints              ck_svconst      s$
 entereval      eval "string"           ck_eval         d%      S
 leaveeval      eval "string" exit      ck_null         1       S
 #evalonce      eval constant string    ck_null         d1      S
-entertry       eval {block}            ck_eval         d%      
+entertry       eval {block}            ck_eval         d|      
 leavetry       eval {block} exit       ck_null         @       
 
 # Get system info.