aboutsummaryrefslogtreecommitdiff
path: root/arm64/isel.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2017-05-17 09:40:07 -0400
committerQuentin Carbonneaux <[email protected]>2017-05-17 10:05:28 -0400
commita3a1451c5fabb5c94f7fbeb13fdc6b1e2c23181f (patch)
tree1fb1ba60e8f3cab09c629ce9dd63e00e01974c39 /arm64/isel.c
parent2d02070af019e9896ecf2a63bedc098092fd395d (diff)
intern symbol names
Symbols in the source file are still limited in length because the rest of the code assumes that strings always fit in NString bytes. Regardless, there is already a benefit because comparing/copying symbol names does not require using strcmp()/strcpy() anymore.
Diffstat (limited to 'arm64/isel.c')
-rw-r--r--arm64/isel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arm64/isel.c b/arm64/isel.c
index 2d4e995..7ab368f 100644
--- a/arm64/isel.c
+++ b/arm64/isel.c
@@ -69,6 +69,7 @@ Check:
static void
fixarg(Ref *pr, int k, int phi, Fn *fn)
{
+ char buf[32];
Ref r0, r1, r2;
int s, n;
Con *c;
@@ -86,8 +87,9 @@ fixarg(Ref *pr, int k, int phi, Fn *fn)
n = gasstashfp(c->bits.i, KWIDE(k));
vgrow(&fn->con, ++fn->ncon);
c = &fn->con[fn->ncon-1];
+ sprintf(buf, "fp%d", n);
*c = (Con){.type = CAddr, .local = 1};
- sprintf(c->label, "fp%d", n);
+ c->label = intern(buf);
r2 = newtmp("isel", Kl, fn);
emit(Oload, k, r1, r2, R);
emit(Ocopy, Kl, r2, CON(c-fn->con), R);