Try to preserve the lost opcode alias info in comments
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 31 Oct 2005 16:18:03 +0000 (16:18 +0000)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 31 Oct 2005 16:18:03 +0000 (16:18 +0000)
extent to change #25929
p4raw-link: @25929 on //depot/perl: 1d5774de323ac43a91c2a30cf2e40384e4754f98

p4raw-id: //depot/perl@25930

opcode.h
opcode.pl

index d52088a..5aef24e 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -894,8 +894,8 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
        MEMBER_TO_FPTR(Perl_pp_aelem),
        MEMBER_TO_FPTR(Perl_pp_aslice),
        MEMBER_TO_FPTR(Perl_pp_each),
-       MEMBER_TO_FPTR(Perl_do_kv),
-       MEMBER_TO_FPTR(Perl_do_kv),
+       MEMBER_TO_FPTR(Perl_do_kv),     /* Perl_pp_values */
+       MEMBER_TO_FPTR(Perl_do_kv),     /* Perl_pp_keys */
        MEMBER_TO_FPTR(Perl_pp_delete),
        MEMBER_TO_FPTR(Perl_pp_exists),
        MEMBER_TO_FPTR(Perl_pp_rv2hv),
index a3284da..ffe4901 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -39,11 +39,11 @@ my %alias;
 
 # Format is "this function" => "does these op names"
 my @raw_alias = (
-                Perl_do_kv => 'keys values',
+                Perl_do_kv => [qw( keys values )],
                );
 
 while (my ($func, $names) = splice @raw_alias, 0, 2) {
-    $alias{$_} = $func foreach split ' ', $names;
+    $alias{$_} = $func for @$names;
 }
 
 # Emit defines.
@@ -183,8 +183,13 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
 END
 
 for (@ops) {
-    my $name = $alias{$_} || "Perl_pp_$_";
-    print "\tMEMBER_TO_FPTR($name),\n" unless $_ eq "custom";
+    $_ eq "custom" and next;
+    if (my $name = $alias{$_}) {
+       print "\tMEMBER_TO_FPTR($name),\t/* Perl_pp_$_ */\n";
+    }
+    else {
+       print "\tMEMBER_TO_FPTR(Perl_pp_$_),\n";
+    }
 }
 
 print <<END;