implement line number info tracking

Support "file" and "loc" directives. "file" takes a string (a file name)
assigns it a number, sets the current file to that number and records
the string for later. "loc" takes a single number and outputs location
information with a reference to the current file.
This commit is contained in:
Thomas Bracht Laumann Jespersen 2023-01-26 12:09:44 +01:00 committed by Quentin Carbonneaux
parent e493a7f233
commit 0d929287d7
10 changed files with 75 additions and 7 deletions

View file

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

View file

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