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:
parent
e493a7f233
commit
0d929287d7
10 changed files with 75 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue