]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: remove dead code
authorDmitry Vyukov <dvyukov@google.com>
Sun, 8 Feb 2015 16:07:48 +0000 (19:07 +0300)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 9 Feb 2015 08:30:32 +0000 (08:30 +0000)
Change-Id: Ib46a42fc873066b1cc00368fe43648f08dce48bd
Reviewed-on: https://go-review.googlesource.com/4200
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/gc/dcl.c
src/cmd/gc/go.h
src/cmd/gc/init.c
src/cmd/gc/lex.c
src/cmd/gc/subr.c

index f47ca2b50ede8493ec63ec3ea31b465e591b10db..9a6c0023f5b2b8a7d488b8779f5e26ddbbe15620 100644 (file)
@@ -1435,7 +1435,7 @@ addmethod(Sym *sf, Type *t, int local, int nointerface)
 }
 
 void
-funccompile(Node *n, int isclosure)
+funccompile(Node *n)
 {
        stksize = BADWIDTH;
        maxarg = 0;
@@ -1449,20 +1449,6 @@ funccompile(Node *n, int isclosure)
        // assign parameter offsets
        checkwidth(n->type);
        
-       // record offset to actual frame pointer.
-       // for closure, have to skip over leading pointers and PC slot.
-       // TODO(rsc): this is the old jit closure handling code.
-       // with the new closures, isclosure is always 0; delete this block.
-       nodfp->xoffset = 0;
-       if(isclosure) {
-               NodeList *l;
-               for(l=n->nname->ntype->list; l; l=l->next) {
-                       nodfp->xoffset += widthptr;
-                       if(l->n->left == N)     // found slot for PC
-                               break;
-               }
-       }
-
        if(curfn)
                fatal("funccompile %S inside %S", n->nname->sym, curfn->nname->sym);
 
index 2aa7838c93dcbbb038f0b1dda22f5c5e191795d5..c765e063bd110fdd631d901ec68e6fe06e4900de 100644 (file)
@@ -1128,7 +1128,7 @@ void      dumpdcl(char *st);
 Node*  embedded(Sym *s, Pkg *pkg);
 Node*  fakethis(void);
 void   funcbody(Node *n);
-void   funccompile(Node *n, int isclosure);
+void   funccompile(Node *n);
 void   funchdr(Node *n);
 Type*  functype(Node *this, NodeList *in, NodeList *out);
 void   ifacedcl(Node *n);
index 918d37180b5f35d424283815be1a9329805007de..c769ec27f06ce9f95ffa7338c4d414f41c9457b7 100644 (file)
@@ -191,5 +191,5 @@ fninit(NodeList *n)
        typecheck(&fn, Etop);
        typechecklist(r, Etop);
        curfn = nil;
-       funccompile(fn, 0);
+       funccompile(fn);
 }
index 042099bd5e75e9ae3ed243bdd4c0ade1b702430e..01dd1664cb6a2cf514129c80cb8907a31a93d170 100644 (file)
@@ -459,7 +459,7 @@ gcmain(int argc, char *argv[])
        // Phase 7: Compile top level functions.
        for(l=xtop; l; l=l->next)
                if(l->n->op == ODCLFUNC)
-                       funccompile(l->n, 0);
+                       funccompile(l->n);
 
        if(nsavederrors+nerrors == 0)
                fninit(xtop);
index 5a522efec225e882514a969d45a06e1a15d67f65..fc925bbec32be680ac5afc7ec52b520915a83610 100644 (file)
@@ -2628,7 +2628,7 @@ genwrapper(Type *rcvr, Type *method, Sym *newnam, int iface)
        inl_nonlocal = 0;
 
        curfn = nil;
-       funccompile(fn, 0);
+       funccompile(fn);
 }
 
 static Node*
@@ -2876,7 +2876,7 @@ genhash(Sym *sym, Type *t)
        // an unexported field of type unsafe.Pointer.
        old_safemode = safemode;
        safemode = 0;
-       funccompile(fn, 0);
+       funccompile(fn);
        safemode = old_safemode;
 }
 
@@ -3096,7 +3096,7 @@ geneq(Sym *sym, Type *t)
        // an unexported field of type unsafe.Pointer.
        old_safemode = safemode;
        safemode = 0;
-       funccompile(fn, 0);
+       funccompile(fn);
        safemode = old_safemode;
 }