From cbee74bdb4f85d6d8d4f192f0018ea023418e216 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 22 Nov 2022 21:44:44 +0100 Subject: 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. --- rv64/isel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rv64/isel.c') diff --git a/rv64/isel.c b/rv64/isel.c index 42c0097..8921a07 100644 --- a/rv64/isel.c +++ b/rv64/isel.c @@ -46,7 +46,7 @@ fixarg(Ref *r, int k, Ins *i, 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); emit(Oload, k, r1, CON(c-fn->con), R); break; } -- cgit 1.4.1