Browse Source

replace asm keyword

when applying a custom set of CFLAGS under clang that does not include
-std=c99, asm is treated as a keyword and as such can not be used as an
identifier. this prevents the issue by renaming the offending variables.
Erica Z 1 year ago
parent
commit
c8220b638b
3 changed files with 6 additions and 6 deletions
  1. 2 2
      amd64/emit.c
  2. 2 2
      arm64/emit.c
  3. 2 2
      rv64/emit.c

+ 2 - 2
amd64/emit.c

@@ -60,7 +60,7 @@ enum {
 static struct {
 	short op;
 	short cls;
-	char *asm;
+	char *fmt;
 } omap[] = {
 	{ Oadd,    Ka, "+add%k %1, %=" },
 	{ Osub,    Ka, "-sub%k %1, %=" },
@@ -393,7 +393,7 @@ emitins(Ins i, Fn *fn, FILE *f)
 			|| (omap[o].cls == Ka))
 				break;
 		}
-		emitf(omap[o].asm, &i, fn, f);
+		emitf(omap[o].fmt, &i, fn, f);
 		break;
 	case Onop:
 		/* just do nothing for nops, they are inserted

+ 2 - 2
arm64/emit.c

@@ -37,7 +37,7 @@ enum {
 static struct {
 	short op;
 	short cls;
-	char *asm;
+	char *fmt;
 } omap[] = {
 	{ Oadd,    Ki, "add %=, %0, %1" },
 	{ Oadd,    Ka, "fadd %=, %0, %1" },
@@ -374,7 +374,7 @@ emitins(Ins *i, E *e)
 			|| (omap[o].cls == Ki && KBASE(i->cls) == 0))
 				break;
 		}
-		emitf(omap[o].asm, i, e);
+		emitf(omap[o].fmt, i, e);
 		break;
 	case Onop:
 		break;

+ 2 - 2
rv64/emit.c

@@ -8,7 +8,7 @@ enum {
 static struct {
 	short op;
 	short cls;
-	char *asm;
+	char *fmt;
 } omap[] = {
 	{ Oadd,    Ki, "add%k %=, %0, %1" },
 	{ Oadd,    Ka, "fadd.%k %=, %0, %1" },
@@ -326,7 +326,7 @@ emitins(Ins *i, Fn *fn, FILE *f)
 			|| (omap[o].cls == Ki && KBASE(i->cls) == 0))
 				break;
 		}
-		emitf(omap[o].asm, i, fn, f);
+		emitf(omap[o].fmt, i, fn, f);
 		break;
 	case Ocopy:
 		if (req(i->to, i->arg[0]))