1
0
mirror of https://github.com/golang/go synced 2024-11-23 21:10:05 -07:00

cmd/compile/internal/gc: remove commented-out code from esc.go

Also adjust some comments to where they belong.

Change-Id: Ifbb38052401b0d33d7bb9800f56a20ce8f39c25f
Reviewed-on: https://go-review.googlesource.com/127761
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Iskander Sharipov 2018-08-06 14:24:13 +03:00 committed by Brad Fitzpatrick
parent d778a371be
commit 0c706fddce

View File

@ -502,8 +502,6 @@ func escAnalyze(all []*Node, recursive bool) {
}
}
// print("escapes: %d e.dsts, %d edges\n", e.dstcount, e.edgecount);
// visit the upstream of each dst, mark address nodes with
// addrescapes, mark parameters unsafe
escapes := make([]uint16, len(e.dsts))
@ -551,7 +549,6 @@ func escAnalyze(all []*Node, recursive bool) {
}
func (e *EscState) escfunc(fn *Node) {
// print("escfunc %N %s\n", fn.Func.Nname, e.recursive?"(recursive)":"");
if fn.Esc != EscFuncPlanned {
Fatalf("repeat escfunc %v", fn.Func.Nname)
}
@ -630,8 +627,6 @@ func (e *EscState) escloopdepth(n *Node) {
// Walk will complain about this label being already defined, but that's not until
// after escape analysis. in the future, maybe pull label & goto analysis out of walk and put before esc
// if(n.Left.Sym.Label != nil)
// fatal("escape analysis messed up analyzing label: %+N", n);
n.Left.Sym.Label = asTypesNode(&nonlooping)
case OGOTO:
@ -756,10 +751,6 @@ opSwitch:
e.loopdepth++
}
// See case OLABEL in escloopdepth above
// else if(n.Left.Sym.Label == nil)
// fatal("escape analysis missed or messed up a label: %+N", n);
n.Left.Sym.Label = nil
case ORANGE:
@ -1561,12 +1552,11 @@ func (e *EscState) esccall(call *Node, parent *Node) {
cE := e.nodeEscState(call)
if fn != nil && fn.Op == ONAME && fn.Class() == PFUNC &&
fn.Name.Defn != nil && fn.Name.Defn.Nbody.Len() != 0 && fn.Name.Param.Ntype != nil && fn.Name.Defn.Esc < EscFuncTagged {
// function in same mutually recursive group. Incorporate into flow graph.
if Debug['m'] > 3 {
fmt.Printf("%v::esccall:: %S in recursive group\n", linestr(lineno), call)
}
// function in same mutually recursive group. Incorporate into flow graph.
// print("esc local fn: %N\n", fn.Func.Ntype);
if fn.Name.Defn.Esc == EscFuncUnknown || cE.Retval.Len() != 0 {
Fatalf("graph inconsistency")
}
@ -1629,8 +1619,6 @@ func (e *EscState) esccall(call *Node, parent *Node) {
// set up out list on this call node with dummy auto ONAMES in the current (calling) function.
e.initEscRetval(call, fntype)
// print("esc analyzed fn: %#N (%+T) returning (%+H)\n", fn, fntype, e.nodeEscState(call).Retval);
// Receiver.
if call.Op != OCALLFUNC {
rf := fntype.Recv()