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

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