9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] cc: take our pickle out of the peephole
@ 2022-10-01 23:19 Anthony Martin
  2022-10-01 23:24 ` unobe
  2022-10-02 18:08 ` ori
  0 siblings, 2 replies; 7+ messages in thread
From: Anthony Martin @ 2022-10-01 23:19 UTC (permalink / raw)
  To: 9front


The -P flag is used to debug the peephole optimizer. The -Z flag is
used to output pickling code for various types. Don't confuse the two.

The pickling code was added in the third edition. It mistakenly reused
the -P flag which was later partially corrected to use the -Z flag in
2004. That change updated lex.c but missed the code in pickle.c.

---
diff 7bf177b3e058925265863979ee50e8dc1822d17a b44281c5cf3db0ca60a22df94bbe99e8bcf9c9e3
--- a/sys/src/cmd/cc/pickle.c	Tue Aug 23 04:38:49 2022
+++ b/sys/src/cmd/cc/pickle.c	Sat Oct 1 15:48:00 2022
@@ -172,9 +172,9 @@
 	int n;
 	char *an;

-	if(!debug['P'])
+	if(!debug['Z'])
 		return;
-	if(debug['P'] > 1) {
+	if(debug['Z'] > 1) {
 		n = 0;
 		for(i=iostack; i; i=i->link)
 			n++;
@@ -221,9 +221,9 @@
 	Type *t;
 	Sym *s1, *s2;

-	if(!debug['P'] || debug['s'])
+	if(!debug['Z'] || debug['s'])
 		return;
-	if(debug['P'] > 1) {
+	if(debug['Z'] > 1) {
 		n = 0;
 		for(i=iostack; i; i=i->link)
 			n++;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-13  8:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-01 23:19 [9front] [PATCH] cc: take our pickle out of the peephole Anthony Martin
2022-10-01 23:24 ` unobe
2022-10-13  0:34   ` Anthony Martin
2022-10-13  3:08     ` Noam Preil
2022-10-13  8:02       ` Steve Simon
2022-10-13  8:56         ` hiro
2022-10-02 18:08 ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).