Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(51)

Side by Side Diff: src/cmd/cc/dcl.c

Issue 160200044: [dev.power64] code review 160200044: build: merge default into dev.power64 (Closed)
Patch Set: diff -r be0c14f62257b42485019e9e1db23cf40d2e249f https://code.google.com/p/go Created 10 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/cmd/cc/cc.y ('k') | src/cmd/cc/godefs.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Inferno utils/cc/dcl.c 1 // Inferno utils/cc/dcl.c
2 // http://code.google.com/p/inferno-os/source/browse/utils/cc/dcl.c 2 // http://code.google.com/p/inferno-os/source/browse/utils/cc/dcl.c
3 // 3 //
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
6 // Portions Copyright © 1997-1999 Vita Nuova Limited 6 // Portions Copyright © 1997-1999 Vita Nuova Limited
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com) 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com)
8 // Portions Copyright © 2004,2006 Bruce Ellis 8 // Portions Copyright © 2004,2006 Bruce Ellis
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 } 690 }
691 691
692 #define ANSIPROTO 1 692 #define ANSIPROTO 1
693 #define OLDPROTO 2 693 #define OLDPROTO 2
694 694
695 void 695 void
696 argmark(Node *n, int pass) 696 argmark(Node *n, int pass)
697 { 697 {
698 Type *t; 698 Type *t;
699 699
700 » autoffset = align(0, thisfn->link, Aarg0, nil); 700 » if(hasdotdotdot(thisfn->link))
701 » » autoffset = align(0, thisfn->link, Aarg0, nil);
701 stkoff = 0; 702 stkoff = 0;
702 for(; n->left != Z; n = n->left) { 703 for(; n->left != Z; n = n->left) {
703 if(n->op != OFUNC || n->left->op != ONAME) 704 if(n->op != OFUNC || n->left->op != ONAME)
704 continue; 705 continue;
705 walkparam(n->right, pass); 706 walkparam(n->right, pass);
706 if(pass != 0 && anyproto(n->right) == OLDPROTO) { 707 if(pass != 0 && anyproto(n->right) == OLDPROTO) {
707 t = typ(TFUNC, n->left->sym->type->link); 708 t = typ(TFUNC, n->left->sym->type->link);
708 t->down = typ(TOLD, T); 709 t->down = typ(TOLD, T);
709 t->down->down = ofnproto(n->right); 710 t->down->down = ofnproto(n->right);
710 tmerge(t, n->left->sym); 711 tmerge(t, n->left->sym);
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 c = CSTATIC; 1395 c = CSTATIC;
1395 } 1396 }
1396 if(s->type != T) 1397 if(s->type != T)
1397 if(s->class != c || !sametype(t, s->type) || t->etype == TENUM) { 1398 if(s->class != c || !sametype(t, s->type) || t->etype == TENUM) {
1398 diag(Z, "external redeclaration of: %s", s->name); 1399 diag(Z, "external redeclaration of: %s", s->name);
1399 Bprint(&diagbuf, " %s %T %L\n", cnames[c], t, nearl n); 1400 Bprint(&diagbuf, " %s %T %L\n", cnames[c], t, nearl n);
1400 Bprint(&diagbuf, " %s %T %L\n", cnames[s->class], s ->type, s->varlineno); 1401 Bprint(&diagbuf, " %s %T %L\n", cnames[s->class], s ->type, s->varlineno);
1401 } 1402 }
1402 tmerge(t, s); 1403 tmerge(t, s);
1403 s->type = t; 1404 s->type = t;
1405 if(c == CTYPEDEF && (typechlv[t->etype] || typefd[t->etype])) {
1406 s->type = copytyp(t);
1407 s->type->tag = s;
1408 }
1404 s->class = c; 1409 s->class = c;
1405 s->block = 0; 1410 s->block = 0;
1406 s->offset = o; 1411 s->offset = o;
1407 } 1412 }
1408 1413
1409 void 1414 void
1410 tmerge(Type *t1, Sym *s) 1415 tmerge(Type *t1, Sym *s)
1411 { 1416 {
1412 Type *ta, *tb, *t2; 1417 Type *ta, *tb, *t2;
1413 1418
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 t1 = t1->link; 1479 t1 = t1->link;
1475 t2 = t2->link; 1480 t2 = t2->link;
1476 } 1481 }
1477 } 1482 }
1478 1483
1479 void 1484 void
1480 edecl(int c, Type *t, Sym *s) 1485 edecl(int c, Type *t, Sym *s)
1481 { 1486 {
1482 Type *t1; 1487 Type *t1;
1483 1488
1484 » if(s == S) { 1489 » if(s == S)
1485 » » if(!typesu[t->etype]) 1490 » » diag(Z, "unnamed structure elements not supported");
1486 » » » diag(Z, "unnamed structure element must be struct/union" ); 1491 » else
1487 » » if(c != CXXX)
1488 » » » diag(Z, "unnamed structure element cannot have class");
1489 » } else
1490 if(c != CXXX) 1492 if(c != CXXX)
1491 diag(Z, "structure element cannot have class: %s", s->na me); 1493 diag(Z, "structure element cannot have class: %s", s->na me);
1492 t1 = t; 1494 t1 = t;
1493 t = copytyp(t1); 1495 t = copytyp(t1);
1494 t->sym = s; 1496 t->sym = s;
1495 t->down = T; 1497 t->down = T;
1496 if(lastfield) { 1498 if(lastfield) {
1497 t->shift = lastbit - lastfield; 1499 t->shift = lastbit - lastfield;
1498 t->nbits = lastfield; 1500 t->nbits = lastfield;
1499 if(firstbit) 1501 if(firstbit)
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 q = new(OADDR, q, 0); 1695 q = new(OADDR, q, 0);
1694 1696
1695 q = new(OASI, p, q); 1697 q = new(OASI, p, q);
1696 r = new(OLIST, q, r); 1698 r = new(OLIST, q, r);
1697 1699
1698 n = new(OLIST, r, n); 1700 n = new(OLIST, r, n);
1699 1701
1700 no: 1702 no:
1701 return n; 1703 return n;
1702 } 1704 }
OLDNEW
« no previous file with comments | « src/cmd/cc/cc.y ('k') | src/cmd/cc/godefs.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b