mirror of
https://github.com/golang/go
synced 2024-11-21 22:54:40 -07:00
gc: inlining, allow empty bodies, fix _ arguments.
R=rsc CC=golang-dev https://golang.org/cl/5487077
This commit is contained in:
parent
5b2f8d96ce
commit
7e6890a670
@ -914,6 +914,9 @@ stmtfmt(Fmt *f, Node *n)
|
||||
fmtprint(f, "%#O", n->op);
|
||||
break;
|
||||
|
||||
case OEMPTY:
|
||||
break;
|
||||
|
||||
case OLABEL:
|
||||
fmtprint(f, "%N: ", n->left);
|
||||
break;
|
||||
@ -1018,6 +1021,7 @@ static int opprec[] = {
|
||||
[ODCL] = -1,
|
||||
[ODCLFIELD] = -1,
|
||||
[ODEFER] = -1,
|
||||
[OEMPTY] = -1,
|
||||
[OFALL] = -1,
|
||||
[OFOR] = -1,
|
||||
[OIF] = -1,
|
||||
|
@ -60,7 +60,7 @@ caninl(Node *fn)
|
||||
case ORETURN:
|
||||
case OAS:
|
||||
case OAS2:
|
||||
// case OEMPTY: // TODO
|
||||
case OEMPTY:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -449,7 +449,7 @@ mkinlcall(Node **np, Node *fn)
|
||||
// TODO check that n->list->n is a call?
|
||||
as->rlist = n->list;
|
||||
for(t = getinargx(fn->type)->type; t; t=t->down) {
|
||||
if(t->nname) {
|
||||
if(t->nname && !isblank(t->nname)) {
|
||||
if(!t->nname->inlvar)
|
||||
fatal("missing inlvar for %N\n", t->nname);
|
||||
as->list = list(as->list, t->nname->inlvar);
|
||||
@ -460,7 +460,7 @@ mkinlcall(Node **np, Node *fn)
|
||||
} else {
|
||||
ll = n->list;
|
||||
for(t = getinargx(fn->type)->type; t && ll; t=t->down) {
|
||||
if(t->nname) {
|
||||
if(t->nname && !isblank(t->nname)) {
|
||||
if(!t->nname->inlvar)
|
||||
fatal("missing inlvar for %N\n", t->nname);
|
||||
as->list = list(as->list, t->nname->inlvar);
|
||||
|
@ -8,7 +8,8 @@ package main
|
||||
|
||||
import "unsafe"
|
||||
|
||||
func use(bool) {}
|
||||
var global bool
|
||||
func use(b bool) { global = b }
|
||||
|
||||
func stringptr(s string) uintptr { return *(*uintptr)(unsafe.Pointer(&s)) }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user