LEFT | RIGHT |
(no file at all) | |
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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 622 |
623 // binary | 623 // binary |
624 case OCAP: | 624 case OCAP: |
625 case OCOM: | 625 case OCOM: |
626 case OLEN: | 626 case OLEN: |
627 case OMINUS: | 627 case OMINUS: |
628 case ONOT: | 628 case ONOT: |
629 case OPLUS: | 629 case OPLUS: |
630 cgen_discard(nr->left); | 630 cgen_discard(nr->left); |
631 break; | 631 break; |
| 632 ········ |
| 633 case OIND: |
| 634 cgen_checknil(nr->left); |
| 635 break; |
632 | 636 |
633 // special enough to just evaluate | 637 // special enough to just evaluate |
634 default: | 638 default: |
635 tempname(&tmp, nr->type); | 639 tempname(&tmp, nr->type); |
636 cgen_as(&tmp, nr); | 640 cgen_as(&tmp, nr); |
637 gused(&tmp); | 641 gused(&tmp); |
638 } | 642 } |
639 } | 643 } |
640 | 644 |
641 /* | 645 /* |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 Node* | 930 Node* |
927 temp(Type *t) | 931 temp(Type *t) |
928 { | 932 { |
929 Node *n; | 933 Node *n; |
930 ········ | 934 ········ |
931 n = nod(OXXX, N, N); | 935 n = nod(OXXX, N, N); |
932 tempname(n, t); | 936 tempname(n, t); |
933 n->sym->def->used = 1; | 937 n->sym->def->used = 1; |
934 return n; | 938 return n; |
935 } | 939 } |
LEFT | RIGHT |