summaryrefslogtreecommitdiff
path: root/src/cmd/6l/obj.c
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2009-11-04 18:17:57 -0800
committerKen Thompson <ken@golang.org>2009-11-04 18:17:57 -0800
commit4aea02feb7aba0dd724b17e5fdb2ada173542ecf (patch)
tree6096a01a45cfcd7ee826e643ed09bf7c9fdaa64c /src/cmd/6l/obj.c
parentce9b3deaa4fa22e9d5580df05e9762b988793baa (diff)
downloadgolang-4aea02feb7aba0dd724b17e5fdb2ada173542ecf.tar.gz
speed up 6l
hopefully no change R=rsc http://go/go-review/1017035
Diffstat (limited to 'src/cmd/6l/obj.c')
-rw-r--r--src/cmd/6l/obj.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index 7098b42eb..ffe93fce4 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -408,12 +408,11 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
Auto *u;
t = Bgetc(f);
+ a->index = D_NONE;
+ a->scale = 0;
if(t & T_INDEX) {
a->index = Bgetc(f);
a->scale = Bgetc(f);
- } else {
- a->index = D_NONE;
- a->scale = 0;
}
a->offset = 0;
if(t & T_OFFSET) {
@@ -438,16 +437,17 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
}
if(t & T_TYPE)
a->type = Bgetc(f);
+ adrgotype = S;
if(t & T_GOTYPE)
- a->gotype = h[Bgetc(f)];
+ adrgotype = h[Bgetc(f)];
s = a->sym;
if(s == S)
return;
t = a->type;
if(t != D_AUTO && t != D_PARAM) {
- if(a->gotype)
- s->gotype = a->gotype;
+ if(adrgotype)
+ s->gotype = adrgotype;
return;
}
l = a->offset;
@@ -456,8 +456,8 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
if(u->type == t) {
if(u->aoffset > l)
u->aoffset = l;
- if(a->gotype)
- u->gotype = a->gotype;
+ if(adrgotype)
+ u->gotype = adrgotype;
return;
}
}
@@ -468,7 +468,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
u->asym = s;
u->aoffset = l;
u->type = t;
- u->gotype = a->gotype;
+ u->gotype = adrgotype;
}
void
@@ -575,7 +575,10 @@ loop:
p->line = Bget4(f);
p->back = 2;
p->mode = mode;
+ p->ft = 0;
+ p->tt = 0;
zaddr(f, &p->from, h);
+ fromgotype = adrgotype;
zaddr(f, &p->to, h);
if(debug['W'])
@@ -673,8 +676,8 @@ loop:
// redefinitions.
s = p->from.sym;
if(s != S && s->dupok) {
- if(debug['v'])
- Bprint(&bso, "skipping %s in %s: dupok\n", s->name, pn);
+// if(debug['v'])
+// Bprint(&bso, "skipping %s in %s: dupok\n", s->name, pn);
goto loop;
}
if(s != S) {
@@ -720,10 +723,10 @@ loop:
}
diag("%s: redefinition: %s\n%P", pn, s->name, p);
}
- if(p->from.gotype) {
- if(s->gotype && s->gotype != p->from.gotype)
+ if(fromgotype) {
+ if(s->gotype && s->gotype != fromgotype)
diag("%s: type mismatch for %s", pn, s->name);
- s->gotype = p->from.gotype;
+ s->gotype = fromgotype;
}
newtext(p, s);
goto loop;