diff options
author | Quentin Carbonneaux <quentin@c9x.me> | 2022-11-22 21:44:44 +0100 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2022-11-22 21:56:21 +0100 |
commit | cbee74bdb4f85d6d8d4f192f0018ea023418e216 (patch) | |
tree | 4ea3eb41265e44336d81fecf719193c67540f3d3 /arm64/isel.c | |
parent | 04e26409011389f7b5759114905195a4fb0b0286 (diff) | |
download | roux-cbee74bdb4f85d6d8d4f192f0018ea023418e216.tar.gz |
use a new struct for symbols
Symbols are a useful abstraction that occurs in both Con and Alias. In this patch they get their own struct. This new struct packages a symbol name and a type; the type tells us where the symbol name must be interpreted (currently, in gobal memory or in thread-local storage). The refactor fixed a bug in addcon(), proving the value of packaging symbol names with their type.
Diffstat (limited to 'arm64/isel.c')
-rw-r--r-- | arm64/isel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arm64/isel.c b/arm64/isel.c index 31ef242..9b062d8 100644 --- a/arm64/isel.c +++ b/arm64/isel.c @@ -80,7 +80,7 @@ fixarg(Ref *pr, int k, int phi, Fn *fn) c = &fn->con[r0.val]; if (T.apple && c->type == CAddr - && c->reloc == RelThr) { + && c->sym.type == SThr) { r1 = newtmp("isel", Kl, fn); *pr = r1; if (c->bits.i) { @@ -114,7 +114,7 @@ fixarg(Ref *pr, int k, int phi, Fn *fn) c = &fn->con[fn->ncon-1]; sprintf(buf, "\"%sfp%d\"", T.asloc, n); *c = (Con){.type = CAddr}; - c->label = intern(buf); + c->sym.id = intern(buf); r2 = newtmp("isel", Kl, fn); emit(Oload, k, r1, r2, R); emit(Ocopy, Kl, r2, CON(c-fn->con), R); |