瀏覽代碼

file,loc become dbgfile,dbgloc

Quentin Carbonneaux 2 年之前
父節點
當前提交
36946a5142
共有 7 個文件被更改,包括 13 次插入13 次删除
  1. 1 1
      amd64/emit.c
  2. 1 1
      amd64/isel.c
  3. 1 1
      arm64/emit.c
  4. 1 1
      ops.h
  5. 6 6
      parse.c
  6. 1 1
      rv64/emit.c
  7. 2 2
      tools/lexh.c

+ 1 - 1
amd64/emit.c

@@ -547,7 +547,7 @@ emitins(Ins i, Fn *fn, FILE *f)
 		emitcopy(i.arg[0], i.arg[1], i.cls, fn, f);
 		emitcopy(i.arg[0], i.arg[1], i.cls, fn, f);
 		emitcopy(i.arg[1], TMP(XMM0+15), i.cls, fn, f);
 		emitcopy(i.arg[1], TMP(XMM0+15), i.cls, fn, f);
 		break;
 		break;
-	case Oloc:
+	case Odbgloc:
 		emitdbgloc(i.arg[0].val, f);
 		emitdbgloc(i.arg[0].val, f);
 		break;
 		break;
 	}
 	}

+ 1 - 1
amd64/isel.c

@@ -392,7 +392,7 @@ sel(Ins i, ANum *an, Fn *fn)
 	case_Oload:
 	case_Oload:
 		seladdr(&i.arg[0], an, fn);
 		seladdr(&i.arg[0], an, fn);
 		goto Emit;
 		goto Emit;
-	case Oloc:
+	case Odbgloc:
 	case Ocall:
 	case Ocall:
 	case Osalloc:
 	case Osalloc:
 	case Ocopy:
 	case Ocopy:

+ 1 - 1
arm64/emit.c

@@ -446,7 +446,7 @@ emitins(Ins *i, E *e)
 		if (!req(i->to, R))
 		if (!req(i->to, R))
 			emitf("mov %=, sp", i, e);
 			emitf("mov %=, sp", i, e);
 		break;
 		break;
-	case Oloc:
+	case Odbgloc:
 		emitdbgloc(i->arg[0].val, e->f);
 		emitdbgloc(i->arg[0].val, e->f);
 		break;
 		break;
 	}
 	}

+ 1 - 1
ops.h

@@ -122,7 +122,7 @@ O(vastart, T(m,e,e,e, x,e,e,e), 0) X(0, 0, 0) V(0)
 O(copy,    T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) V(0)
 O(copy,    T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) V(0)
 
 
 /* Debug */
 /* Debug */
-O(loc,     T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) V(0)
+O(dbgloc,  T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) V(0)
 
 
 /****************************************/
 /****************************************/
 /* INTERNAL OPERATIONS (keep nop first) */
 /* INTERNAL OPERATIONS (keep nop first) */

+ 6 - 6
parse.c

@@ -53,7 +53,7 @@ enum Token {
 	Tdata,
 	Tdata,
 	Tsection,
 	Tsection,
 	Talign,
 	Talign,
-	Tfile,
+	Tdbgfile,
 	Tl,
 	Tl,
 	Tw,
 	Tw,
 	Tsh,
 	Tsh,
@@ -111,7 +111,7 @@ static char *kwmap[Ntok] = {
 	[Tdata] = "data",
 	[Tdata] = "data",
 	[Tsection] = "section",
 	[Tsection] = "section",
 	[Talign] = "align",
 	[Talign] = "align",
-	[Tfile] = "file",
+	[Tdbgfile] = "dbgfile",
 	[Tsb] = "sb",
 	[Tsb] = "sb",
 	[Tub] = "ub",
 	[Tub] = "ub",
 	[Tsh] = "sh",
 	[Tsh] = "sh",
@@ -132,7 +132,7 @@ enum {
 	TMask = 16383, /* for temps hash */
 	TMask = 16383, /* for temps hash */
 	BMask = 8191, /* for blocks hash */
 	BMask = 8191, /* for blocks hash */
 
 
-	K = 10525445, /* found using tools/lexh.c */
+	K = 9583425, /* found using tools/lexh.c */
 	M = 23,
 	M = 23,
 };
 };
 
 
@@ -661,8 +661,8 @@ parseline(PState ps)
 		expect(Tnl);
 		expect(Tnl);
 		closeblk();
 		closeblk();
 		return PLbl;
 		return PLbl;
-	case Oloc:
-		op = Oloc;
+	case Odbgloc:
+		op = t;
 		k = Kw;
 		k = Kw;
 		r = R;
 		r = R;
 		expect(Tint);
 		expect(Tint);
@@ -1186,7 +1186,7 @@ parse(FILE *f, char *path, void dbgfile(char *), void data(Dat *), void func(Fn
 		switch (parselnk(&lnk)) {
 		switch (parselnk(&lnk)) {
 		default:
 		default:
 			err("top-level definition expected");
 			err("top-level definition expected");
-		case Tfile:
+		case Tdbgfile:
 			expect(Tstr);
 			expect(Tstr);
 			dbgfile(tokval.str);
 			dbgfile(tokval.str);
 			break;
 			break;

+ 1 - 1
rv64/emit.c

@@ -405,7 +405,7 @@ emitins(Ins *i, Fn *fn, FILE *f)
 		if (!req(i->to, R))
 		if (!req(i->to, R))
 			emitf("mv %=, sp", i, fn, f);
 			emitf("mv %=, sp", i, fn, f);
 		break;
 		break;
-	case Oloc:
+	case Odbgloc:
 		emitdbgloc(i->arg[0].val, f);
 		emitdbgloc(i->arg[0].val, f);
 		break;
 		break;
 	}
 	}

+ 2 - 2
tools/lexh.c

@@ -23,10 +23,10 @@ char *tok[] = {
 	"ceql", "cnel", "cles", "clts", "cgts", "cges",
 	"ceql", "cnel", "cles", "clts", "cgts", "cges",
 	"cnes", "ceqs", "cos", "cuos", "cled", "cltd",
 	"cnes", "ceqs", "cos", "cuos", "cled", "cltd",
 	"cgtd", "cged", "cned", "ceqd", "cod", "cuod",
 	"cgtd", "cged", "cned", "ceqd", "cod", "cuod",
-	"vaarg", "vastart", "...", "env", "loc",
+	"vaarg", "vastart", "...", "env", "dbgloc",
 
 
 	"call", "phi", "jmp", "jnz", "ret", "hlt", "export",
 	"call", "phi", "jmp", "jnz", "ret", "hlt", "export",
-	"function", "type", "data", "section", "align", "file",
+	"function", "type", "data", "section", "align", "dbgfile",
 	"blit", "l", "w", "sh", "uh", "h", "sb", "ub", "b",
 	"blit", "l", "w", "sh", "uh", "h", "sb", "ub", "b",
 	"d", "s", "z", "loadw", "loadl", "loads", "loadd",
 	"d", "s", "z", "loadw", "loadl", "loads", "loadd",
 	"alloc1", "alloc2",
 	"alloc1", "alloc2",