From 680e94e43017d0b7cb7a0ec21fb289b4f2cce758 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 4 Aug 2009 22:59:23 -0700 Subject: make Syms smaller. collapse a lot of duplication in dcl.c switch to NodeList* from Dcl* R=ken OCL=32770 CL=32770 --- src/cmd/gc/obj.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/cmd/gc/obj.c') 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); } } -- cgit v1.2.3