Correct way of setting maybe_unsused on labels
authorMiodrag Milanovic <mmicko@gmail.com>
Fri, 5 Nov 2021 09:36:15 +0000 (10:36 +0100)
committerMiodrag Milanovic <mmicko@gmail.com>
Fri, 5 Nov 2021 09:36:15 +0000 (10:36 +0100)
passes/pmgen/pmgen.py

index 6e2fabeebde5ca71799fbd6058d263e49b390b7b..c599d31a63cda752ece2bce6689da254e63f00b8 100644 (file)
@@ -679,16 +679,14 @@ with open(outfile, "w") as f:
             print("#undef subpattern", file=f)
 
             print("", file=f)
-            print("rollback_label:", file=f)
-            print("    YS_MAYBE_UNUSED;", file=f)
+            print("YS_MAYBE_UNUSED rollback_label:;", file=f)
 
             if len(block["fcode"]):
                 print("#define accept do { accept_cnt++; on_accept(); } while(0)", file=f)
                 print("#define finish do { rollback = -1; goto finish_label; } while(0)", file=f)
                 for line in block["fcode"]:
                     print("  " + line, file=f)
-                print("finish_label:", file=f)
-                print("    YS_MAYBE_UNUSED;", file=f)
+                print("YS_MAYBE_UNUSED finish_label:;", file=f)
                 print("#undef accept", file=f)
                 print("#undef finish", file=f)