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

Side by Side Diff: src/cmd/gc/gen.c

Issue 154540044: code review 154540044: cmd/gc: emit code for extern = <N> (Closed)
Patch Set: diff -r 8a62c0b8dfd46cccb317d2f75b625aa434c650c9 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 | « no previous file | test/fixedbugs/issue8961.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 /* 5 /*
6 * portable half of code generator. 6 * portable half of code generator.
7 * mainly statements and control flow. 7 * mainly statements and control flow.
8 */ 8 */
9 9
10 #include <u.h> 10 #include <u.h>
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 725
726 while(nr != N && nr->op == OCONVNOP) 726 while(nr != N && nr->op == OCONVNOP)
727 nr = nr->left; 727 nr = nr->left;
728 728
729 if(nl == N || isblank(nl)) { 729 if(nl == N || isblank(nl)) {
730 cgen_discard(nr); 730 cgen_discard(nr);
731 return; 731 return;
732 } 732 }
733 733
734 if(nr == N || iszero(nr)) { 734 if(nr == N || iszero(nr)) {
735 » » // externals and heaps should already be clear 735 » » // heaps should already be clear
736 » » if(nr == N) { 736 » » if(nr == N && (nl->class & PHEAP))
737 » » » if(nl->class == PEXTERN) 737 » » » return;
738 » » » » return;
739 » » » if(nl->class & PHEAP)
740 » » » » return;
741 » » }
742 738
743 tl = nl->type; 739 tl = nl->type;
744 if(tl == T) 740 if(tl == T)
745 return; 741 return;
746 if(isfat(tl)) { 742 if(isfat(tl)) {
747 if(nl->op == ONAME) 743 if(nl->op == ONAME)
748 gvardef(nl); 744 gvardef(nl);
749 clearfat(nl); 745 clearfat(nl);
750 return; 746 return;
751 } 747 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 Node* 982 Node*
987 temp(Type *t) 983 temp(Type *t)
988 { 984 {
989 Node *n; 985 Node *n;
990 ········ 986 ········
991 n = nod(OXXX, N, N); 987 n = nod(OXXX, N, N);
992 tempname(n, t); 988 tempname(n, t);
993 n->sym->def->used = 1; 989 n->sym->def->used = 1;
994 return n->orig; 990 return n->orig;
995 } 991 }
OLDNEW
« no previous file with comments | « no previous file | test/fixedbugs/issue8961.go » ('j') | no next file with comments »

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