summaryrefslogtreecommitdiff
path: root/regcomp.pl
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-05-05 21:21:05 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-05-10 10:57:49 +0000
commit9b155405e1006cdd8b8d8ffbf82a0cdd100aa3a4 (patch)
tree38467af2f8e77585658939bd07f237423b5161d1 /regcomp.pl
parentfe4c6be141b0b356b13c8403bfd72e3f9e782a25 (diff)
downloadperl-9b155405e1006cdd8b8d8ffbf82a0cdd100aa3a4.tar.gz
Cosmetic: data-driven REx-dump
Message-Id: <199905060521.BAA03485@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@3372
Diffstat (limited to 'regcomp.pl')
-rw-r--r--regcomp.pl25
1 files changed, 23 insertions, 2 deletions
diff --git a/regcomp.pl b/regcomp.pl
index d78321895c..d7d0733010 100644
--- a/regcomp.pl
+++ b/regcomp.pl
@@ -21,7 +21,7 @@ open OUT, ">$tmp_h";
print OUT <<EOP;
/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
- This file is built by regcomp.pl from regcomp.sym.
+ This file is built by regcomp.pl from regcomp.sym.
Any changes made here will be lost!
*/
@@ -79,7 +79,7 @@ EOP
$ind = 0;
while (++$ind <= $tot) {
$size = $longj[$ind] || 0;
-
+
print OUT <<EOP;
$size, /* $name[$ind] */
EOP
@@ -87,6 +87,27 @@ EOP
print OUT <<EOP;
};
+
+#ifdef DEBUGGING
+const static char * const reg_name[] = {
+EOP
+
+$ind = 0;
+while (++$ind <= $tot) {
+ $hind = sprintf "%#4x", $ind-1;
+ $size = $longj[$ind] || 0;
+
+ print OUT <<EOP;
+ "$name[$ind]", /* $hind */
+EOP
+}
+
+print OUT <<EOP;
+};
+
+const static int reg_num = $tot;
+
+#endif /* DEBUGGING */
#endif /* REG_COMP_C */
EOP