mirror of
https://github.com/golang/go
synced 2024-11-26 03:47:57 -07:00
checkpoint; still plenty to clean up
R=ken OCL=32576 CL=32580
This commit is contained in:
parent
9299ae461d
commit
a2b8e38766
@ -52,6 +52,11 @@ builtin.c: sys.go unsafe.go mkbuiltin1.c mkbuiltin
|
|||||||
./mkbuiltin >builtin.c || \
|
./mkbuiltin >builtin.c || \
|
||||||
(echo 'mkbuiltin failed; using bootstrap copy of builtin.c'; cp builtin.c.boot builtin.c)
|
(echo 'mkbuiltin failed; using bootstrap copy of builtin.c'; cp builtin.c.boot builtin.c)
|
||||||
|
|
||||||
|
subr.$O: opnames.h
|
||||||
|
|
||||||
|
opnames.h: mkopnames go.h
|
||||||
|
./mkopnames go.h >opnames.h
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB) mkbuiltin1 builtin.c _builtin.c
|
rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB) mkbuiltin1 builtin.c _builtin.c
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ char *sysimport =
|
|||||||
"func sys.throwindex ()\n"
|
"func sys.throwindex ()\n"
|
||||||
"func sys.throwreturn ()\n"
|
"func sys.throwreturn ()\n"
|
||||||
"func sys.throwinit ()\n"
|
"func sys.throwinit ()\n"
|
||||||
"func sys.panicl (? int32)\n"
|
"func sys.panicl ()\n"
|
||||||
"func sys.printbool (? bool)\n"
|
"func sys.printbool (? bool)\n"
|
||||||
"func sys.printfloat (? float64)\n"
|
"func sys.printfloat (? float64)\n"
|
||||||
"func sys.printint (? int64)\n"
|
"func sys.printint (? int64)\n"
|
||||||
|
@ -1670,7 +1670,7 @@ variter(NodeList *vl, Node *nt, NodeList *el)
|
|||||||
v = vl->n;
|
v = vl->n;
|
||||||
tv = t;
|
tv = t;
|
||||||
if(t == T) {
|
if(t == T) {
|
||||||
gettype(&e, &r);
|
typecheck(&e, Erv);
|
||||||
defaultlit(&e, T);
|
defaultlit(&e, T);
|
||||||
tv = e->type;
|
tv = e->type;
|
||||||
}
|
}
|
||||||
|
109
src/cmd/gc/go.h
109
src/cmd/gc/go.h
@ -320,43 +320,75 @@ enum
|
|||||||
{
|
{
|
||||||
OXXX,
|
OXXX,
|
||||||
|
|
||||||
ONAME, ONONAME, OTYPE, OPACK, OLITERAL,
|
// names
|
||||||
ODCL,
|
ONAME,
|
||||||
ODOT, ODOTPTR, ODOTMETH, ODOTINTER,
|
ONONAME,
|
||||||
ODCLFUNC, ODCLFIELD, ODCLARG,
|
OTYPE,
|
||||||
OCMP, OPTR, OARRAY, ORANGE,
|
OPACK,
|
||||||
ORETURN, OFOR, OIF, OSWITCH, ODEFER,
|
OLITERAL,
|
||||||
OAS, OAS2, OASOP, OCASE, OXCASE, OFALL, OXFALL,
|
|
||||||
OGOTO, OPROC, OMAKE, ONEW, OEMPTY, OSELECT,
|
|
||||||
OLEN, OCAP, OPANIC, OPANICN, OPRINT, OPRINTN, OTYPEOF,
|
|
||||||
OCLOSE, OCLOSED, OBLOCK,
|
|
||||||
|
|
||||||
OOROR,
|
// exprs
|
||||||
OANDAND,
|
|
||||||
OEQ, ONE, OLT, OLE, OGE, OGT,
|
|
||||||
OADD, OSUB, OOR, OXOR,
|
OADD, OSUB, OOR, OXOR,
|
||||||
OMUL, ODIV, OMOD, OLSH, ORSH, OAND, OANDNOT,
|
|
||||||
OINC, ODEC,
|
|
||||||
OFUNC,
|
|
||||||
OLABEL,
|
|
||||||
OBREAK,
|
|
||||||
OCONTINUE,
|
|
||||||
OADDR,
|
OADDR,
|
||||||
OIND,
|
OANDAND,
|
||||||
OCALL, OCALLFUNC, OCALLMETH, OCALLINTER,
|
OARRAY,
|
||||||
OINDEX, OSLICE,
|
OAS, OAS2, OASOP,
|
||||||
ONOT, OCOM, OPLUS, OMINUS, OSEND, ORECV,
|
|
||||||
OREGISTER, OINDREG,
|
|
||||||
OKEY, OPARAM,
|
|
||||||
OCOMPOS, OCOMPSLICE, OCOMPMAP,
|
|
||||||
OCONV, OCONVNOP, OCONVRUNE, OCONVSTRB, OCONVSTRI,
|
|
||||||
OCONVA2S,
|
|
||||||
ODOTTYPE, OTYPESW, OTYPECASE,
|
|
||||||
OBAD,
|
OBAD,
|
||||||
|
OCALL, OCALLFUNC, OCALLMETH, OCALLINTER,
|
||||||
|
OCAP,
|
||||||
|
OCLOSE,
|
||||||
|
OCLOSED,
|
||||||
|
OCOMPOS, OCOMPSLICE, OCOMPMAP,
|
||||||
|
OCONV, OCONVNOP, OCONVRUNE, OCONVSTRB, OCONVSTRI, OCONVA2S,
|
||||||
|
ODCL, ODCLFUNC, ODCLFIELD, ODCLARG,
|
||||||
|
ODOT, ODOTPTR, ODOTMETH, ODOTINTER,
|
||||||
|
ODOTTYPE,
|
||||||
|
OEQ, ONE, OLT, OLE, OGE, OGT,
|
||||||
|
OFUNC,
|
||||||
|
OIND,
|
||||||
|
OINDEX, OINDEXSTR, OINDEXMAP, OINDEXARR,
|
||||||
|
OKEY, OPARAM,
|
||||||
|
OLEN,
|
||||||
|
OMAKE,
|
||||||
|
OMUL, ODIV, OMOD, OLSH, ORSH, OAND, OANDNOT,
|
||||||
|
ONEW,
|
||||||
|
ONOT, OCOM, OPLUS, OMINUS,
|
||||||
|
OOROR,
|
||||||
|
OPANIC, OPANICN, OPRINT, OPRINTN,
|
||||||
|
OSEND,
|
||||||
|
OSLICE, OSLICESTR, OSLICEARR,
|
||||||
|
ORECV,
|
||||||
|
|
||||||
OTCHAN, OTMAP, OTSTRUCT, OTINTER, OTFUNC, OTARRAY,
|
// stmts
|
||||||
|
OBLOCK,
|
||||||
|
OBREAK,
|
||||||
|
OCASE, OXCASE,
|
||||||
|
OCONTINUE,
|
||||||
|
ODEFER,
|
||||||
|
OEMPTY,
|
||||||
|
OFALL, OXFALL,
|
||||||
|
OFOR,
|
||||||
|
OGOTO,
|
||||||
|
OIF,
|
||||||
|
OLABEL,
|
||||||
|
OPROC,
|
||||||
|
ORANGE,
|
||||||
|
ORETURN,
|
||||||
|
OSELECT,
|
||||||
|
OSWITCH,
|
||||||
|
OTYPECASE,
|
||||||
|
OTYPESW,
|
||||||
|
|
||||||
OEXTEND, // 6g internal
|
// types
|
||||||
|
OTCHAN,
|
||||||
|
OTMAP,
|
||||||
|
OTSTRUCT,
|
||||||
|
OTINTER,
|
||||||
|
OTFUNC,
|
||||||
|
OTARRAY,
|
||||||
|
|
||||||
|
// for back ends
|
||||||
|
OCMP, ODEC, OEXTEND, OINC, OREGISTER, OINDREG,
|
||||||
|
|
||||||
OEND,
|
OEND,
|
||||||
};
|
};
|
||||||
@ -936,12 +968,10 @@ Type* pkgtype(Sym*);
|
|||||||
/*
|
/*
|
||||||
* walk.c
|
* walk.c
|
||||||
*/
|
*/
|
||||||
void gettype(Node**, NodeList**);
|
|
||||||
void walk(Node*);
|
void walk(Node*);
|
||||||
void walkstmt(Node**);
|
void walkstmt(Node**);
|
||||||
void walkstmtlist(NodeList*);
|
void walkstmtlist(NodeList*);
|
||||||
void walkexpr(Node**, int, NodeList**);
|
void walkexprlist(NodeList*, NodeList**);
|
||||||
void walkexprlist(NodeList*, int, NodeList**);
|
|
||||||
void walkconv(Node**, NodeList**);
|
void walkconv(Node**, NodeList**);
|
||||||
void walkdottype(Node*, NodeList**);
|
void walkdottype(Node*, NodeList**);
|
||||||
void walkas(Node*);
|
void walkas(Node*);
|
||||||
@ -949,21 +979,20 @@ void walkbool(Node**);
|
|||||||
void walkswitch(Node*);
|
void walkswitch(Node*);
|
||||||
void walkselect(Node*);
|
void walkselect(Node*);
|
||||||
void walkdot(Node*, NodeList**);
|
void walkdot(Node*, NodeList**);
|
||||||
|
void walkexpr(Node**, NodeList**);
|
||||||
Node* ascompatee1(int, Node*, Node*, NodeList**);
|
Node* ascompatee1(int, Node*, Node*, NodeList**);
|
||||||
NodeList* ascompatee(int, NodeList*, NodeList*, NodeList**);
|
NodeList* ascompatee(int, NodeList*, NodeList*, NodeList**);
|
||||||
NodeList* ascompatet(int, NodeList*, Type**, int, NodeList**);
|
NodeList* ascompatet(int, NodeList*, Type**, int, NodeList**);
|
||||||
NodeList* ascompatte(int, Type**, NodeList*, int, NodeList**);
|
NodeList* ascompatte(int, Type**, NodeList*, int, NodeList**);
|
||||||
int ascompat(Type*, Type*);
|
int ascompat(Type*, Type*);
|
||||||
Node* prcompat(NodeList*, int, int);
|
|
||||||
Node* nodpanic(int32);
|
|
||||||
Node* newcompat(Node*);
|
Node* newcompat(Node*);
|
||||||
Node* makecompat(Node*);
|
Node* makecompat(Node*);
|
||||||
Node* stringop(Node*, int, NodeList**);
|
Node* stringop(Node*, NodeList**);
|
||||||
Type* fixmap(Type*);
|
Type* fixmap(Type*);
|
||||||
Node* mapop(Node*, int, NodeList**);
|
Node* mapop(Node*, NodeList**);
|
||||||
Type* fixchan(Type*);
|
Type* fixchan(Type*);
|
||||||
Node* chanop(Node*, int, NodeList**);
|
Node* chanop(Node*, NodeList**);
|
||||||
Node* arrayop(Node*, int);
|
Node* arrayop(Node*);
|
||||||
Node* ifacecvt(Type*, Node*, int);
|
Node* ifacecvt(Type*, Node*, int);
|
||||||
Node* ifaceop(Node*);
|
Node* ifaceop(Node*);
|
||||||
int ifaceas(Type*, Type*, int);
|
int ifaceas(Type*, Type*, int);
|
||||||
|
@ -16,7 +16,7 @@ rm -f _builtin.c
|
|||||||
for i in sys unsafe
|
for i in sys unsafe
|
||||||
do
|
do
|
||||||
$GC -A $i.go
|
$GC -A $i.go
|
||||||
./mkbuiltin1 $i >>_builtin.c
|
O=$O ./mkbuiltin1 $i >>_builtin.c
|
||||||
done
|
done
|
||||||
|
|
||||||
# If _builtin.c has changed vs builtin.c.boot,
|
# If _builtin.c has changed vs builtin.c.boot,
|
||||||
|
@ -26,7 +26,7 @@ main(int argc, char **argv)
|
|||||||
name = argv[1];
|
name = argv[1];
|
||||||
snprintf(initfunc, sizeof(initfunc), "init_%s_function", name);
|
snprintf(initfunc, sizeof(initfunc), "init_%s_function", name);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s.6", name);
|
snprintf(buf, sizeof(buf), "%s.%s", name, getenv("O"));
|
||||||
if((fin = fopen(buf, "r")) == NULL) {
|
if((fin = fopen(buf, "r")) == NULL) {
|
||||||
fprintf(stderr, "open %s: %s\n", buf, strerror(errno));
|
fprintf(stderr, "open %s: %s\n", buf, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "go.h"
|
#include "go.h"
|
||||||
#include "y.tab.h"
|
#include "y.tab.h"
|
||||||
|
#include "opnames.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
errorexit(void)
|
errorexit(void)
|
||||||
@ -612,127 +613,6 @@ dump(char *s, Node *n)
|
|||||||
dodump(n, 1);
|
dodump(n, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
s%,%,\n%g
|
|
||||||
s%\n+%\n%g
|
|
||||||
s%^[ ]*O%%g
|
|
||||||
s%,.*%%g
|
|
||||||
s%.+% [O&] = "&",%g
|
|
||||||
s%^ ........*\]%&~%g
|
|
||||||
s%~ %%g
|
|
||||||
|sort
|
|
||||||
*/
|
|
||||||
|
|
||||||
static char*
|
|
||||||
opnames[] =
|
|
||||||
{
|
|
||||||
[OADDR] = "ADDR",
|
|
||||||
[OADD] = "ADD",
|
|
||||||
[OANDAND] = "ANDAND",
|
|
||||||
[OANDNOT] = "ANDNOT",
|
|
||||||
[OAND] = "AND",
|
|
||||||
[OARRAY] = "ARRAY",
|
|
||||||
[OASOP] = "ASOP",
|
|
||||||
[OAS] = "AS",
|
|
||||||
[OAS2] = "AS2",
|
|
||||||
[OBAD] = "BAD",
|
|
||||||
[OBLOCK] = "BLOCK",
|
|
||||||
[OBREAK] = "BREAK",
|
|
||||||
[OCALLFUNC] = "CALLFUNC",
|
|
||||||
[OCALLINTER] = "CALLINTER",
|
|
||||||
[OCALLMETH] = "CALLMETH",
|
|
||||||
[OCALL] = "CALL",
|
|
||||||
[OCAP] = "CAP",
|
|
||||||
[OCASE] = "CASE",
|
|
||||||
[OCLOSED] = "CLOSED",
|
|
||||||
[OCLOSE] = "CLOSE",
|
|
||||||
[OCMP] = "CMP",
|
|
||||||
[OCOMPMAP] = "COMPMAP",
|
|
||||||
[OCOMPOS] = "COMPOS",
|
|
||||||
[OCOMPSLICE] = "COMPSLICE",
|
|
||||||
[OCOM] = "COM",
|
|
||||||
[OCONTINUE] = "CONTINUE",
|
|
||||||
[OCONV] = "CONV",
|
|
||||||
[OCONVNOP] = "CONVNOP",
|
|
||||||
[ODCLARG] = "DCLARG",
|
|
||||||
[ODCLFIELD] = "DCLFIELD",
|
|
||||||
[ODCLFUNC] = "DCLFUNC",
|
|
||||||
[ODCL] = "DCL",
|
|
||||||
[ODEC] = "DEC",
|
|
||||||
[ODEFER] = "DEFER",
|
|
||||||
[ODIV] = "DIV",
|
|
||||||
[ODOTINTER] = "DOTINTER",
|
|
||||||
[ODOTMETH] = "DOTMETH",
|
|
||||||
[ODOTPTR] = "DOTPTR",
|
|
||||||
[ODOTTYPE] = "DOTTYPE",
|
|
||||||
[ODOT] = "DOT",
|
|
||||||
[OEMPTY] = "EMPTY",
|
|
||||||
[OEND] = "END",
|
|
||||||
[OEQ] = "EQ",
|
|
||||||
[OEXTEND] = "EXTEND",
|
|
||||||
[OFALL] = "FALL",
|
|
||||||
[OFOR] = "FOR",
|
|
||||||
[OFUNC] = "FUNC",
|
|
||||||
[OGE] = "GE",
|
|
||||||
[OGOTO] = "GOTO",
|
|
||||||
[OGT] = "GT",
|
|
||||||
[OIF] = "IF",
|
|
||||||
[OINC] = "INC",
|
|
||||||
[OINDEX] = "INDEX",
|
|
||||||
[OINDREG] = "INDREG",
|
|
||||||
[OIND] = "IND",
|
|
||||||
[OKEY] = "KEY",
|
|
||||||
[OLABEL] = "LABEL",
|
|
||||||
[OLEN] = "LEN",
|
|
||||||
[OLE] = "LE",
|
|
||||||
[OLITERAL] = "LITERAL",
|
|
||||||
[OLSH] = "LSH",
|
|
||||||
[OLT] = "LT",
|
|
||||||
[OMAKE] = "MAKE",
|
|
||||||
[OMINUS] = "MINUS",
|
|
||||||
[OMOD] = "MOD",
|
|
||||||
[OMUL] = "MUL",
|
|
||||||
[ONAME] = "NAME",
|
|
||||||
[ONEW] = "NEW",
|
|
||||||
[ONE] = "NE",
|
|
||||||
[ONONAME] = "NONAME",
|
|
||||||
[ONOT] = "NOT",
|
|
||||||
[OOROR] = "OROR",
|
|
||||||
[OOR] = "OR",
|
|
||||||
[OPANICN] = "PANICN",
|
|
||||||
[OPANIC] = "PANIC",
|
|
||||||
[OPACK] = "PACK",
|
|
||||||
[OPARAM] = "PARAM",
|
|
||||||
[OPLUS] = "PLUS",
|
|
||||||
[OPRINTN] = "PRINTN",
|
|
||||||
[OPRINT] = "PRINT",
|
|
||||||
[OPROC] = "PROC",
|
|
||||||
[OPTR] = "PTR",
|
|
||||||
[ORANGE] = "RANGE",
|
|
||||||
[ORECV] = "RECV",
|
|
||||||
[OREGISTER] = "REGISTER",
|
|
||||||
[ORETURN] = "RETURN",
|
|
||||||
[ORSH] = "RSH",
|
|
||||||
[OSELECT] = "SELECT",
|
|
||||||
[OSEND] = "SEND",
|
|
||||||
[OSLICE] = "SLICE",
|
|
||||||
[OSUB] = "SUB",
|
|
||||||
[OSWITCH] = "SWITCH",
|
|
||||||
[OTCHAN] = "TCHAN",
|
|
||||||
[OTMAP] = "TMAP",
|
|
||||||
[OTSTRUCT] = "TSTRUCT",
|
|
||||||
[OTINTER] = "TINTER",
|
|
||||||
[OTFUNC] = "TFUNC",
|
|
||||||
[OTARRAY] = "TARRAY",
|
|
||||||
[OTYPEOF] = "TYPEOF",
|
|
||||||
[OTYPESW] = "TYPESW",
|
|
||||||
[OTYPE] = "TYPE",
|
|
||||||
[OXCASE] = "XCASE",
|
|
||||||
[OXFALL] = "XFALL",
|
|
||||||
[OXOR] = "XOR",
|
|
||||||
[OXXX] = "XXX",
|
|
||||||
};
|
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
goopnames[] =
|
goopnames[] =
|
||||||
{
|
{
|
||||||
@ -2395,7 +2275,7 @@ saferef(Node *n, NodeList **init)
|
|||||||
*r = *n;
|
*r = *n;
|
||||||
r->left = l;
|
r->left = l;
|
||||||
typecheck(&r, Elv);
|
typecheck(&r, Elv);
|
||||||
walkexpr(&r, Elv, init);
|
walkexpr(&r, init);
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
case OINDEX:
|
case OINDEX:
|
||||||
@ -2405,11 +2285,11 @@ saferef(Node *n, NodeList **init)
|
|||||||
tempname(l, ptrto(n->type));
|
tempname(l, ptrto(n->type));
|
||||||
a = nod(OAS, l, nod(OADDR, n, N));
|
a = nod(OAS, l, nod(OADDR, n, N));
|
||||||
typecheck(&a, Etop);
|
typecheck(&a, Etop);
|
||||||
walkexpr(&a, Etop, init);
|
walkexpr(&a, init);
|
||||||
*init = list(*init, a);
|
*init = list(*init, a);
|
||||||
r = nod(OIND, l, N);
|
r = nod(OIND, l, N);
|
||||||
typecheck(&r, Elv);
|
typecheck(&r, Elv);
|
||||||
walkexpr(&r, Elv, init);
|
walkexpr(&r, init);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
fatal("saferef %N", n);
|
fatal("saferef %N", n);
|
||||||
|
@ -250,7 +250,7 @@ sw0(Node **cp, Type *place, int arg)
|
|||||||
yyerror("expression case in a type switch");
|
yyerror("expression case in a type switch");
|
||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
walkexpr(cp, Erv, nil);
|
walkexpr(cp, nil);
|
||||||
break;
|
break;
|
||||||
case OTYPESW:
|
case OTYPESW:
|
||||||
case OTYPECASE:
|
case OTYPECASE:
|
||||||
@ -596,7 +596,7 @@ exprswitch(Node *sw)
|
|||||||
if(sw->ntest->val.u.bval == 0)
|
if(sw->ntest->val.u.bval == 0)
|
||||||
arg = Sfalse;
|
arg = Sfalse;
|
||||||
}
|
}
|
||||||
walkexpr(&sw->ntest, Erv, &sw->ninit);
|
walkexpr(&sw->ntest, &sw->ninit);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pass 0,1,2,3
|
* pass 0,1,2,3
|
||||||
@ -780,7 +780,7 @@ typeswitch(Node *sw)
|
|||||||
yyerror("type switch must have an assignment");
|
yyerror("type switch must have an assignment");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
walkexpr(&sw->ntest->right, Erv, &sw->ninit);
|
walkexpr(&sw->ntest->right, &sw->ninit);
|
||||||
if(!istype(sw->ntest->right->type, TINTER)) {
|
if(!istype(sw->ntest->right->type, TINTER)) {
|
||||||
yyerror("type switch must be on an interface");
|
yyerror("type switch must be on an interface");
|
||||||
return;
|
return;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|
||||||
package PACKAGE
|
package PACKAGE
|
||||||
|
|
||||||
// emitted by compiler, not referred to by go programs
|
// emitted by compiler, not referred to by go programs
|
||||||
@ -11,7 +10,7 @@ func mal(int32) *any;
|
|||||||
func throwindex();
|
func throwindex();
|
||||||
func throwreturn();
|
func throwreturn();
|
||||||
func throwinit();
|
func throwinit();
|
||||||
func panicl(int32);
|
func panicl();
|
||||||
|
|
||||||
func printbool(bool);
|
func printbool(bool);
|
||||||
func printfloat(float64);
|
func printfloat(float64);
|
||||||
|
@ -315,7 +315,9 @@ reswitch:
|
|||||||
* exprs
|
* exprs
|
||||||
*/
|
*/
|
||||||
case OADDR:
|
case OADDR:
|
||||||
l = typecheck(&n->left, Elv);
|
typecheck(&n->left, Elv);
|
||||||
|
defaultlit(&n->left, T);
|
||||||
|
l = n->left;
|
||||||
if((t = l->type) == T)
|
if((t = l->type) == T)
|
||||||
goto error;
|
goto error;
|
||||||
n->type = ptrto(t);
|
n->type = ptrto(t);
|
||||||
@ -452,6 +454,9 @@ reswitch:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TMAP:
|
case TMAP:
|
||||||
|
n->etype = 0;
|
||||||
|
if(top & Elv)
|
||||||
|
n->etype = 1; // clumsy hack
|
||||||
ok |= Erv | Elv;
|
ok |= Erv | Elv;
|
||||||
defaultlit(&n->right, t->down);
|
defaultlit(&n->right, t->down);
|
||||||
n->type = t->type;
|
n->type = t->type;
|
||||||
@ -499,6 +504,9 @@ reswitch:
|
|||||||
if((t = r->type) == T)
|
if((t = r->type) == T)
|
||||||
goto error;
|
goto error;
|
||||||
// TODO: more aggressive
|
// TODO: more aggressive
|
||||||
|
n->etype = 0;
|
||||||
|
if(top & Erv)
|
||||||
|
n->etype = 1; // clumsy hack
|
||||||
ok |= Etop | Erv;
|
ok |= Etop | Erv;
|
||||||
n->type = types[TBOOL];
|
n->type = types[TBOOL];
|
||||||
goto ret;
|
goto ret;
|
||||||
@ -539,12 +547,15 @@ reswitch:
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
case TARRAY:
|
case TARRAY:
|
||||||
ok |= Elv;
|
n->type = typ(TARRAY);
|
||||||
n = arrayop(n, Erv);
|
n->type->type = t;
|
||||||
|
n->type->bound = -1;
|
||||||
|
n = arrayop(n);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSTRING:
|
case TSTRING:
|
||||||
n = stringop(n, Erv, nil);
|
n->type = t;
|
||||||
|
n = stringop(n, nil);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
goto ret;
|
goto ret;
|
||||||
|
1253
src/cmd/gc/walk.c
1253
src/cmd/gc/walk.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user