]> Cypherpunks repositories - gostls13.git/commitdiff
6g: error messages
authorRuss Cox <rsc@golang.org>
Thu, 7 May 2009 17:30:22 +0000 (10:30 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 7 May 2009 17:30:22 +0000 (10:30 -0700)
part 2; missing files

R=ken
OCL=28408
CL=28410

src/cmd/gc/dcl.c
src/cmd/gc/go.h

index b2eaa09ca5d177bd06f13f5acbd7ff3a4fb71322..202f48f858bca3c2f5fe6f2dc1ac29a1d3f463d7 100644 (file)
@@ -151,14 +151,23 @@ int
 listcount(Node *n)
 {
        int v;
+       Iter s;
 
        v = 0;
-       while(n != N) {
+       for(n = listfirst(&s, &n); n != N; n = listnext(&s))
+               v++;
+       return v;
+}
+
+int
+structcount(Type *t)
+{
+       int v;
+       Iter s;
+
+       v = 0;
+       for(t = structfirst(&s, &t); t != T; t = structnext(&s))
                v++;
-               if(n->op != OLIST)
-                       break;
-               n = n->right;
-       }
        return v;
 }
 
index 91cfed103a98ac1d968ee57a0603c65e4e9fd0e0..c8f3cbf3fe9ad2cc9d9cbb07d5f3bbd4d5ed04bb 100644 (file)
@@ -797,6 +797,7 @@ void        dodclconst(Node*, Node*);
 void   defaultlit(Node*, Type*);
 void   defaultlit2(Node*, Node*);
 int    listcount(Node*);
+int    structcount(Type*);
 void   addmethod(Node*, Type*, int);
 Node*  methodname(Node*, Type*);
 Sym*   methodsym(Sym*, Type*);