]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: allow registerization of temporaries created by inlining.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Fri, 18 Jan 2013 21:25:17 +0000 (22:25 +0100)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Fri, 18 Jan 2013 21:25:17 +0000 (22:25 +0100)
Names beginning with a dot are ignored by optimizers.

R=rsc, lvd, golang-dev, dave
CC=golang-dev
https://golang.org/cl/7098049

src/cmd/gc/dcl.c
src/cmd/gc/inl.c

index 1c15e1eb6ef75e315ad330a6817a88675f8c2e4a..20b0ab904fcd900329e17fccae7a6ba967d6b63d 100644 (file)
@@ -638,7 +638,7 @@ funcargs(Node *nt)
 
                if(n->left == N) {
                        // 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->orig = N;  // signal that the original was absent
 
@@ -653,7 +653,7 @@ funcargs(Node *nt)
                        *nn = *n->left;
                        n->left = nn;
                        
-                       snprint(namebuf, sizeof(namebuf), ".anon%d", gen++);
+                       snprint(namebuf, sizeof(namebuf), "~anon%d", gen++);
                        n->left->sym = lookup(namebuf);
                }
 
index 593533c5050354ce6bab60a03ff173abc150195b..1a6ec3efe01dabb01d110e5a019ff51ec93310bf 100644 (file)
@@ -699,7 +699,7 @@ retvar(Type *t, int i)
 {
        Node *n;
 
-       snprint(namebuf, sizeof(namebuf), ".r%d", i);
+       snprint(namebuf, sizeof(namebuf), "~r%d", i);
        n = newname(lookup(namebuf));
        n->type = t->type;
        n->class = PAUTO;