diff options
author | Thomas Bracht Laumann Jespersen <t@laumann.xyz> | 2023-01-26 12:09:44 +0100 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2023-06-06 18:44:51 +0200 |
commit | 0d929287d77ccc3fb52ca8bd072678b5ae2c81c8 (patch) | |
tree | 72cf91ec66052797059734c9d089a49a69b47122 /amd64 | |
parent | e493a7f23352f51acc0a1e12284ab19d7894488a (diff) | |
download | roux-0d929287d77ccc3fb52ca8bd072678b5ae2c81c8.tar.gz |
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.
Diffstat (limited to 'amd64')
-rw-r--r-- | amd64/emit.c | 3 | ||||
-rw-r--r-- | amd64/isel.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/amd64/emit.c b/amd64/emit.c index 46de3d9..2290d2d 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -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; } } diff --git a/amd64/isel.c b/amd64/isel.c index 3d5d5a9..277063f 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -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: |