diff options
author | Russ Cox <rsc@golang.org> | 2009-08-04 22:59:23 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-08-04 22:59:23 -0700 |
commit | 680e94e43017d0b7cb7a0ec21fb289b4f2cce758 (patch) | |
tree | 39edf90f51b4cf58aa1c2e9ed3e6193ea1f6e610 /src/cmd/gc/obj.c | |
parent | 2f275dfe88e9b6dea79e2e269faf98370f513dd1 (diff) | |
download | golang-680e94e43017d0b7cb7a0ec21fb289b4f2cce758.tar.gz |
make Syms smaller.
collapse a lot of duplication in dcl.c
switch to NodeList* from Dcl*
R=ken
OCL=32770
CL=32770
Diffstat (limited to 'src/cmd/gc/obj.c')
-rw-r--r-- | src/cmd/gc/obj.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/cmd/gc/obj.c b/src/cmd/gc/obj.c index 6bd66d79d..6d2154b28 100644 --- a/src/cmd/gc/obj.c +++ b/src/cmd/gc/obj.c @@ -38,27 +38,23 @@ dumpobj(void) void dumpglobls(void) { - Dcl *d; - Sym *s; Node *n; + NodeList *l; // add globals - for(d=externdcl; d!=D; d=d->forw) { - if(d->op != ONAME) + for(l=externdcl; l; l=l->next) { + n = l->n; + if(n->op != ONAME) continue; - s = d->dsym; - if(s == S) - fatal("external nil"); - n = d->dnode; - if(n == N || n->type == T) - fatal("external %S nil\n", s); - + if(n->type == T) + fatal("external %#N nil type\n", n); if(n->class == PFUNC) continue; - dowidth(n->type); - ggloblnod(s->def, n->type->width); + + // TODO(rsc): why is this not s/n->sym->def/n/ ? + ggloblnod(n->sym->def, n->type->width); } } |