OLD | NEW |
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 #include <u.h> | 5 #include <u.h> |
6 #include <libc.h> | 6 #include <libc.h> |
7 #include "go.h" | 7 #include "go.h" |
8 | 8 |
9 static Node* walkprint(Node*, NodeList**, int); | 9 static Node* walkprint(Node*, NodeList**, int); |
10 static Node* mapfn(char*, Type*); | 10 static Node* mapfn(char*, Type*); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 case OPLUS: | 400 case OPLUS: |
401 case OCOM: | 401 case OCOM: |
402 case OREAL: | 402 case OREAL: |
403 case OIMAG: | 403 case OIMAG: |
404 case ODOTMETH: | 404 case ODOTMETH: |
405 case ODOTINTER: | 405 case ODOTINTER: |
406 walkexpr(&n->left, init); | 406 walkexpr(&n->left, init); |
407 goto ret; | 407 goto ret; |
408 | 408 |
409 case OIND: | 409 case OIND: |
410 if(n->left->type->type->width == 0) { | |
411 // No actual copy will be generated, so emit an explicit
nil check. | |
412 n->left = cheapexpr(n->left, init); | |
413 checknil(n->left, init); | |
414 } | |
415 walkexpr(&n->left, init); | 410 walkexpr(&n->left, init); |
416 goto ret; | 411 goto ret; |
417 | 412 |
418 case ODOT: | 413 case ODOT: |
419 usefield(n); | 414 usefield(n); |
420 walkexpr(&n->left, init); | 415 walkexpr(&n->left, init); |
421 goto ret; | 416 goto ret; |
422 | 417 |
423 case ODOTPTR: | 418 case ODOTPTR: |
424 usefield(n); | 419 usefield(n); |
(...skipping 3314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3739 !candiscardlist(n->ninit) || | 3734 !candiscardlist(n->ninit) || |
3740 !candiscardlist(n->nbody) || | 3735 !candiscardlist(n->nbody) || |
3741 !candiscardlist(n->nelse) || | 3736 !candiscardlist(n->nelse) || |
3742 !candiscardlist(n->list) || | 3737 !candiscardlist(n->list) || |
3743 !candiscardlist(n->rlist)) { | 3738 !candiscardlist(n->rlist)) { |
3744 return 0; | 3739 return 0; |
3745 } | 3740 } |
3746 ········ | 3741 ········ |
3747 return 1; | 3742 return 1; |
3748 } | 3743 } |
OLD | NEW |