]> thyrsus.com Git - intercal.git/commitdiff
Label the exact optimisation used when debugging the optimser
authorAlex Smith <ais523@bham.ac.uk>
Tue, 31 Aug 2010 03:46:52 +0000 (04:46 +0100)
committerAlex Smith <ais523@bham.ac.uk>
Tue, 31 Aug 2010 03:46:52 +0000 (04:46 +0100)
src/oil.y

index 5e5cecbec5c1f017dee0d89d4e1c0f1f0e58b62f..9739257f43ad32b39c3fd4dedc0bcc84fef68510 100644 (file)
--- a/src/oil.y
+++ b/src/oil.y
@@ -95,6 +95,7 @@ struct ickstype
 
 #define MAXOPTNAMELEN 64
 char optname[MAXOPTNAMELEN]="undefined";
+int optnumber = 0;
 
 typedef struct ickstype *YYSTYPE;
 
@@ -236,7 +237,7 @@ optimization: template '-' '>' replacement
   }
   /* If we reach this point in the generated code, we have an optimizer
      template match. */
-  printf("    OPTING(%s);\n",optname);
+  printf("    OPTING(%s_%d);\n",optname,++optnumber);
 
   /* We now need to replace np with its replacement. This is done by creating
      a new nodetree, copying across tempmem'd nodes where necessary, and then
@@ -394,6 +395,7 @@ int yylex(void)
        c=countgetchar();
        if(i==MAXOPTNAMELEN-1) {i=0; yyerror("optimization name too long");}
       }
+      optnumber=0;
       optname[i]=0;
       c=countgetchar();
       while(isspace(c)) c=countgetchar();