summaryrefslogtreecommitdiff
path: root/src/cmd/gc/pgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/gc/pgen.c')
-rw-r--r--src/cmd/gc/pgen.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cmd/gc/pgen.c b/src/cmd/gc/pgen.c
index abe8ea892..d16481b66 100644
--- a/src/cmd/gc/pgen.c
+++ b/src/cmd/gc/pgen.c
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+#include <u.h>
+#include <libc.h>
#include "gg.h"
#include "opt.h"
-static void compactframe(Prog* p);
+static void allocauto(Prog* p);
void
compile(Node *fn)
@@ -58,8 +60,6 @@ compile(Node *fn)
if(nerrors != 0)
goto ret;
- allocparams();
-
continpc = P;
breakpc = P;
@@ -113,9 +113,9 @@ compile(Node *fn)
}
oldstksize = stksize;
- compactframe(ptxt);
+ allocauto(ptxt);
if(0)
- print("compactframe: %ld to %ld\n", oldstksize, stksize);
+ print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize);
defframe(ptxt);
@@ -145,13 +145,13 @@ cmpstackvar(Node *a, Node *b)
// TODO(lvd) find out where the PAUTO/OLITERAL nodes come from.
static void
-compactframe(Prog* ptxt)
+allocauto(Prog* ptxt)
{
NodeList *ll;
Node* n;
vlong w;
- if (stksize == 0)
+ if(curfn->dcl == nil)
return;
// Mark the PAUTO's unused.
@@ -188,6 +188,7 @@ compactframe(Prog* ptxt)
if (n->class != PAUTO || n->op != ONAME)
continue;
+ dowidth(n->type);
w = n->type->width;
if(w >= MAXWIDTH || w < 0)
fatal("bad width");