summaryrefslogtreecommitdiff
path: root/opcode.pl
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-08-02 20:24:41 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-08-02 20:24:41 +0000
commitabdd5c84f1a598169caec84a2fd2acc62163ef45 (patch)
tree7e993f7e63462e0ddf9c8666d517e15d2b849342 /opcode.pl
parentc2d5f1fae400f78eebab28009881b1a60e4d4ad3 (diff)
downloadperl-abdd5c84f1a598169caec84a2fd2acc62163ef45.tar.gz
fix broken -DDEBUGGING_OPS (from Spider Boardman
<spider@leggy.zk3.dec.com>) p4raw-id: //depot/perl@3902
Diffstat (limited to 'opcode.pl')
-rwxr-xr-xopcode.pl23
1 files changed, 17 insertions, 6 deletions
diff --git a/opcode.pl b/opcode.pl
index 6e56a10142..f1127452b3 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -1,7 +1,8 @@
#!/usr/bin/perl
-unlink "opcode.h";
+unlink "opcode.h", "opnames.h";
open(OC, ">opcode.h") || die "Can't create opcode.h: $!\n";
+open(ON, ">opnames.h") || die "Can't create opnames.h: $!\n";
select OC;
# Read data.
@@ -39,14 +40,23 @@ print <<"END";
#define Perl_pp_i_postinc Perl_pp_postinc
#define Perl_pp_i_postdec Perl_pp_postdec
-typedef enum {
END
+
+print ON <<"END";
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ This file is built by opcode.pl from its data. Any changes made here
+ will be lost!
+*/
+
+typedef enum opcode {
+END
+
for (@ops) {
- print "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
+ print ON "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
}
-print "\t", &tab(3,"OP_max"), "\n";
-print "} opcode;\n";
-print "\n#define MAXO ", scalar @ops, "\n\n";
+print ON "\t", &tab(3,"OP_max"), "\n";
+print ON "} opcode;\n";
+print ON "\n#define MAXO ", scalar @ops, "\n\n";
# Emit op names and descriptions.
@@ -214,6 +224,7 @@ END_EXTERN_C
END
close OC or die "Error closing opcode.h: $!";
+close ON or die "Error closing opnames.h: $!";
unlink "pp_proto.h";
unlink "pp.sym";