summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--6/asm.h4
-rw-r--r--6/gen.c4
-rw-r--r--6/gengas.c2
-rw-r--r--6/genp9.c4
-rw-r--r--6/locs.c2
-rw-r--r--6/simp.c4
-rw-r--r--mkfile2
7 files changed, 11 insertions, 11 deletions
diff --git a/6/asm.h b/6/asm.h
index 7506db0..c228a04 100644
--- a/6/asm.h
+++ b/6/asm.h
@@ -210,8 +210,8 @@ void genp9(Node *file, char *out);
extern size_t maxregid;
extern Loc **locmap; /* mapping from reg id => Loc * */
-char *gendatalbl(char *buf, size_t sz);
-char *genjmplbl(char *buf, size_t sz);
+char *genlocallblstr(char *buf, size_t sz);
+char *genlblstr(char *buf, size_t sz);
Node *genlbl(Srcloc loc);
Loc *loclbl(Node *lbl);
Loc *locstrlbl(char *lbl);
diff --git a/6/gen.c b/6/gen.c
index 363799d..8959877 100644
--- a/6/gen.c
+++ b/6/gen.c
@@ -24,7 +24,7 @@ static int islocal(Node *dcl)
}
static int nextlbl;
-char *gendatalbl(char *buf, size_t sz)
+char *genlocallblstr(char *buf, size_t sz)
{
if (asmsyntax == Plan9)
snprintf(buf, 128, ".L%d<>", nextlbl++);
@@ -33,7 +33,7 @@ char *gendatalbl(char *buf, size_t sz)
return buf;
}
-char *genjmplbl(char *buf, size_t sz)
+char *genlblstr(char *buf, size_t sz)
{
snprintf(buf, 128, ".L%d", nextlbl++);
return buf;
diff --git a/6/gengas.c b/6/gengas.c
index 29218f1..7b40856 100644
--- a/6/gengas.c
+++ b/6/gengas.c
@@ -293,7 +293,7 @@ static size_t writelit(FILE *fd, Htab *strtab, Node *v, Type *ty)
if (hthas(strtab, &v->lit.strval)) {
lbl = htget(strtab, &v->lit.strval);
} else {
- lbl = gendatalbl(buf, sizeof buf);
+ lbl = genlocallblstr(buf, sizeof buf);
htput(strtab, &v->lit.strval, strdup(lbl));
}
fprintf(fd, "\t.quad %s\n", lbl);
diff --git a/6/genp9.c b/6/genp9.c
index fdd513b..7a591b9 100644
--- a/6/genp9.c
+++ b/6/genp9.c
@@ -298,7 +298,7 @@ static size_t writelit(FILE *fd, char *name, size_t off, Htab *strtab, Node *v,
if (hthas(strtab, &v->lit.strval)) {
lbl = htget(strtab, &v->lit.strval);
} else {
- lbl = gendatalbl(buf, sizeof buf);
+ lbl = genlocallblstr(buf, sizeof buf);
htput(strtab, &v->lit.strval, strdup(lbl));
}
if (v->lit.strval.len > 0)
@@ -361,7 +361,7 @@ static size_t writeslice(FILE *fd, char *name, size_t off, Htab *globls, Htab *s
lbl = htget(globls, base);
fprintf(fd, "DATA %s+%zd(SB)/8,$%s+%zd(SB)\n", name, off, lbl, loval*sz);
- fprintf(fd, "DATA %s+%zd(SB)/8,$%zd\n", name, off, (hival - loval));
+ fprintf(fd, "DATA %s+%zd(SB)/8,$%zd\n", name, off + Ptrsz, (hival - loval));
return size(n);
}
diff --git a/6/locs.c b/6/locs.c
index c5816a1..994e7f4 100644
--- a/6/locs.c
+++ b/6/locs.c
@@ -35,7 +35,7 @@ Node *genlbl(Srcloc loc)
{
char buf[128];
- genjmplbl(buf, 128);
+ genlblstr(buf, 128);
return mklbl(loc, buf);
}
diff --git a/6/simp.c b/6/simp.c
index 9b458ca..7e62fec 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -688,14 +688,14 @@ static Node *simpblob(Simp *s, Node *blob, Node ***l, size_t *nl)
Node *n, *d, *r;
char lbl[128];
- n = mkname(blob->loc, gendatalbl(lbl, 128));
+ n = mkname(blob->loc, genlblstr(lbl, 128));
d = mkdecl(blob->loc, n, blob->expr.type);
r = mkexpr(blob->loc, Ovar, n, NULL);
d->decl.init = blob;
d->decl.type = blob->expr.type;
d->decl.isconst = 1;
- htput(s->globls, d, strdup(lbl));
+ htput(s->globls, d, asmname(d));
r->expr.did = d->decl.did;
r->expr.type = blob->expr.type;
diff --git a/mkfile b/mkfile
index 748d1e0..fcdbfb9 100644
--- a/mkfile
+++ b/mkfile
@@ -40,7 +40,7 @@ uninstall:V: $SUB config.h
mk $MKFLAGS
}
-check:V:
+check:V: all
cd test
mk check