Commit dfdfba14 authored by Rémy Oudompheng's avatar Rémy Oudompheng

cmd/gc: allow registerization of temporaries created by inlining.

Names beginning with a dot are ignored by optimizers.

R=rsc, lvd, golang-dev, dave
CC=golang-dev
https://golang.org/cl/7098049
parent f579faa6
...@@ -638,7 +638,7 @@ funcargs(Node *nt) ...@@ -638,7 +638,7 @@ funcargs(Node *nt)
if(n->left == N) { if(n->left == N) {
// give it a name so escape analysis has nodes to work with // give it a name so escape analysis has nodes to work with
snprint(namebuf, sizeof(namebuf), ".anon%d", gen++); snprint(namebuf, sizeof(namebuf), "~anon%d", gen++);
n->left = newname(lookup(namebuf)); n->left = newname(lookup(namebuf));
n->left->orig = N; // signal that the original was absent n->left->orig = N; // signal that the original was absent
...@@ -653,7 +653,7 @@ funcargs(Node *nt) ...@@ -653,7 +653,7 @@ funcargs(Node *nt)
*nn = *n->left; *nn = *n->left;
n->left = nn; n->left = nn;
snprint(namebuf, sizeof(namebuf), ".anon%d", gen++); snprint(namebuf, sizeof(namebuf), "~anon%d", gen++);
n->left->sym = lookup(namebuf); n->left->sym = lookup(namebuf);
} }
......
...@@ -699,7 +699,7 @@ retvar(Type *t, int i) ...@@ -699,7 +699,7 @@ retvar(Type *t, int i)
{ {
Node *n; Node *n;
snprint(namebuf, sizeof(namebuf), ".r%d", i); snprint(namebuf, sizeof(namebuf), "~r%d", i);
n = newname(lookup(namebuf)); n = newname(lookup(namebuf));
n->type = t->type; n->type = t->type;
n->class = PAUTO; n->class = PAUTO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment