LEFT | RIGHT |
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 <bio.h> | 5 #include <bio.h> |
6 | 6 |
7 #undef OAPPEND | 7 #undef OAPPEND |
8 | 8 |
9 // avoid <ctype.h> | 9 // avoid <ctype.h> |
10 #undef isblank | 10 #undef isblank |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 // TFIELD | 176 // TFIELD |
177 Type* down; // also used in TMAP | 177 Type* down; // also used in TMAP |
178 Strlit* note; // literal string annotation | 178 Strlit* note; // literal string annotation |
179 | 179 |
180 // TARRAY | 180 // TARRAY |
181 int32 bound; // negative is dynamic array | 181 int32 bound; // negative is dynamic array |
182 | 182 |
183 int32 maplineno; // first use of TFORW as map key | 183 int32 maplineno; // first use of TFORW as map key |
184 int32 embedlineno; // first use of TFORW as embedded type | 184 int32 embedlineno; // first use of TFORW as embedded type |
| 185 ········ |
| 186 // for TFORW, where to copy the eventual value to |
| 187 NodeList *copyto; |
185 }; | 188 }; |
186 #define T ((Type*)0) | 189 #define T ((Type*)0) |
187 | 190 |
188 typedef struct InitEntry InitEntry; | 191 typedef struct InitEntry InitEntry; |
189 typedef struct InitPlan InitPlan; | 192 typedef struct InitPlan InitPlan; |
190 | 193 |
191 struct InitEntry | 194 struct InitEntry |
192 { | 195 { |
193 vlong xoffset; // struct, array only | 196 vlong xoffset; // struct, array only |
194 Node *key; // map only | 197 Node *key; // map only |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 OTSTRUCT, | 481 OTSTRUCT, |
479 OTINTER, | 482 OTINTER, |
480 OTFUNC, | 483 OTFUNC, |
481 OTARRAY, | 484 OTARRAY, |
482 OTPAREN, | 485 OTPAREN, |
483 | 486 |
484 // misc | 487 // misc |
485 ODDD, | 488 ODDD, |
486 ODDDARG, | 489 ODDDARG, |
487 OINLCALL, // intermediary representation of an inlined call | 490 OINLCALL, // intermediary representation of an inlined call |
488 » OIFACE,»// itable and data words of interface value | 491 » OEFACE,»// itable and data words of empty-interface value |
489 OITAB, // itable word of interface value | 492 OITAB, // itable word of interface value |
490 | 493 |
491 // for back ends | 494 // for back ends |
492 OCMP, ODEC, OEXTEND, OINC, OREGISTER, OINDREG, | 495 OCMP, ODEC, OEXTEND, OINC, OREGISTER, OINDREG, |
493 OLROT, | 496 OLROT, |
494 | 497 |
495 OEND, | 498 OEND, |
496 }; | 499 }; |
497 enum | 500 enum |
498 { | 501 { |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 void funccompile(Node *n, int isclosure); | 939 void funccompile(Node *n, int isclosure); |
937 void funchdr(Node *n); | 940 void funchdr(Node *n); |
938 Type* functype(Node *this, NodeList *in, NodeList *out); | 941 Type* functype(Node *this, NodeList *in, NodeList *out); |
939 void ifacedcl(Node *n); | 942 void ifacedcl(Node *n); |
940 int isifacemethod(Type *f); | 943 int isifacemethod(Type *f); |
941 void markdcl(void); | 944 void markdcl(void); |
942 Node* methodname(Node *n, Type *t); | 945 Node* methodname(Node *n, Type *t); |
943 Node* methodname1(Node *n, Node *t); | 946 Node* methodname1(Node *n, Node *t); |
944 Sym* methodsym(Sym *nsym, Type *t0, int iface); | 947 Sym* methodsym(Sym *nsym, Type *t0, int iface); |
945 Node* newname(Sym *s); | 948 Node* newname(Sym *s); |
946 Type* newtype(Sym *s); | |
947 Node* oldname(Sym *s); | 949 Node* oldname(Sym *s); |
948 void popdcl(void); | 950 void popdcl(void); |
949 void poptodcl(void); | 951 void poptodcl(void); |
950 void redeclare(Sym *s, char *where); | 952 void redeclare(Sym *s, char *where); |
951 void testdclstack(void); | 953 void testdclstack(void); |
952 Type* tointerface(NodeList *l); | 954 Type* tointerface(NodeList *l); |
953 Type* tostruct(NodeList *l); | 955 Type* tostruct(NodeList *l); |
954 Node* typedcl0(Sym *s); | 956 Node* typedcl0(Sym *s); |
955 Node* typedcl1(Node *n, Node *t, int local); | 957 Node* typedcl1(Node *n, Node *t, int local); |
956 Node* typenod(Type *t); | 958 Node* typenod(Type *t); |
(...skipping 24 matching lines...) Expand all Loading... |
981 void fmtinstallgo(void); | 983 void fmtinstallgo(void); |
982 void dump(char *s, Node *n); | 984 void dump(char *s, Node *n); |
983 void dumplist(char *s, NodeList *l); | 985 void dumplist(char *s, NodeList *l); |
984 | 986 |
985 /* | 987 /* |
986 * gen.c | 988 * gen.c |
987 */ | 989 */ |
988 void addrescapes(Node *n); | 990 void addrescapes(Node *n); |
989 void cgen_as(Node *nl, Node *nr); | 991 void cgen_as(Node *nl, Node *nr); |
990 void cgen_callmeth(Node *n, int proc); | 992 void cgen_callmeth(Node *n, int proc); |
991 void» cgen_iface(Node* n, Node* res); | 993 void» cgen_eface(Node* n, Node* res); |
992 void cgen_slice(Node* n, Node* res); | 994 void cgen_slice(Node* n, Node* res); |
993 void clearlabels(void); | 995 void clearlabels(void); |
994 void checklabels(void); | 996 void checklabels(void); |
995 int dotoffset(Node *n, int *oary, Node **nn); | 997 int dotoffset(Node *n, int *oary, Node **nn); |
996 void gen(Node *n); | 998 void gen(Node *n); |
997 void genlist(NodeList *l); | 999 void genlist(NodeList *l); |
998 Node* sysfunc(char *name); | 1000 Node* sysfunc(char *name); |
999 void tempname(Node *n, Type *t); | 1001 void tempname(Node *n, Type *t); |
1000 Node* temp(Type*); | 1002 Node* temp(Type*); |
1001 | 1003 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 void typecheckswitch(Node *n); | 1248 void typecheckswitch(Node *n); |
1247 void walkswitch(Node *sw); | 1249 void walkswitch(Node *sw); |
1248 | 1250 |
1249 /* | 1251 /* |
1250 * typecheck.c | 1252 * typecheck.c |
1251 */ | 1253 */ |
1252 int islvalue(Node *n); | 1254 int islvalue(Node *n); |
1253 Node* typecheck(Node **np, int top); | 1255 Node* typecheck(Node **np, int top); |
1254 void typechecklist(NodeList *l, int top); | 1256 void typechecklist(NodeList *l, int top); |
1255 Node* typecheckdef(Node *n); | 1257 Node* typecheckdef(Node *n); |
1256 void resumetypecopy(void); | |
1257 void copytype(Node *n, Type *t); | 1258 void copytype(Node *n, Type *t); |
1258 void defertypecopy(Node *n, Type *t); | |
1259 void queuemethod(Node *n); | 1259 void queuemethod(Node *n); |
1260 | 1260 |
1261 /* | 1261 /* |
1262 * unsafe.c | 1262 * unsafe.c |
1263 */ | 1263 */ |
1264 int isunsafebuiltin(Node *n); | 1264 int isunsafebuiltin(Node *n); |
1265 Node* unsafenmagic(Node *n); | 1265 Node* unsafenmagic(Node *n); |
1266 | 1266 |
1267 /* | 1267 /* |
1268 * walk.c | 1268 * walk.c |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 #pragma varargck type "P" Prog* | 1363 #pragma varargck type "P" Prog* |
1364 #pragma varargck type "Q" Bits | 1364 #pragma varargck type "Q" Bits |
1365 #pragma varargck type "R" int | 1365 #pragma varargck type "R" int |
1366 #pragma varargck type "S" Sym* | 1366 #pragma varargck type "S" Sym* |
1367 #pragma varargck type "lS" Sym* | 1367 #pragma varargck type "lS" Sym* |
1368 #pragma varargck type "T" Type* | 1368 #pragma varargck type "T" Type* |
1369 #pragma varargck type "lT" Type* | 1369 #pragma varargck type "lT" Type* |
1370 #pragma varargck type "V" Val* | 1370 #pragma varargck type "V" Val* |
1371 #pragma varargck type "Y" char* | 1371 #pragma varargck type "Y" char* |
1372 #pragma varargck type "Z" Strlit* | 1372 #pragma varargck type "Z" Strlit* |
LEFT | RIGHT |