diff options
| author | Russ Cox <rsc@golang.org> | 2020-12-07 14:56:49 -0500 | 
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2020-12-17 03:49:45 +0000 | 
| commit | 5ae70b85c6c40adb4e785bf988799df9c0a57e16 (patch) | |
| tree | def39d8242071d17802ebb4ee0a21544db6f6be0 /src/cmd/compile/internal/gc/alg.go | |
| parent | fa06894b36054e80e815ee538fb6f72c9e58f14a (diff) | |
| download | go-git-5ae70b85c6c40adb4e785bf988799df9c0a57e16.tar.gz | |
[dev.regabi] cmd/compile: cleanup preparing for concrete types, 2
Avoid using the same variable for two different concrete
Node types in other files (beyond walk). This will smooth the
introduction of specific constructors, replacing ir.Nod and friends.
Passes buildall w/ toolstash -cmp.
Replay of CL 275885, lost to the bad-merge history rewrite.
Change-Id: I0da89502a0bd636b8766f01b6f843c7821b3e9ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/277955
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/alg.go')
| -rw-r--r-- | src/cmd/compile/internal/gc/alg.go | 20 | 
1 files changed, 9 insertions, 11 deletions
diff --git a/src/cmd/compile/internal/gc/alg.go b/src/cmd/compile/internal/gc/alg.go index 7540944201..8550edb9e0 100644 --- a/src/cmd/compile/internal/gc/alg.go +++ b/src/cmd/compile/internal/gc/alg.go @@ -819,12 +819,12 @@ func eqstring(s, t ir.Node) (eqlen, eqmem ir.Node) {  	fn = substArgTypes(fn, types.Types[types.TUINT8], types.Types[types.TUINT8])  	call := ir.Nod(ir.OCALL, fn, nil)  	call.PtrList().Append(sptr, tptr, ir.Copy(slen)) -	call = typecheck(call, ctxExpr|ctxMultiOK) +	call1 := typecheck(call, ctxExpr|ctxMultiOK)  	cmp := ir.Nod(ir.OEQ, slen, tlen) -	cmp = typecheck(cmp, ctxExpr) +	cmp1 := typecheck(cmp, ctxExpr)  	cmp.SetType(types.Types[types.TBOOL]) -	return cmp, call +	return cmp1, call1  }  // eqinterface returns the nodes @@ -857,21 +857,19 @@ func eqinterface(s, t ir.Node) (eqtab, eqdata ir.Node) {  	call := ir.Nod(ir.OCALL, fn, nil)  	call.PtrList().Append(stab, sdata, tdata) -	call = typecheck(call, ctxExpr|ctxMultiOK) +	call1 := typecheck(call, ctxExpr|ctxMultiOK)  	cmp := ir.Nod(ir.OEQ, stab, ttab) -	cmp = typecheck(cmp, ctxExpr) -	cmp.SetType(types.Types[types.TBOOL]) -	return cmp, call +	cmp1 := typecheck(cmp, ctxExpr) +	cmp1.SetType(types.Types[types.TBOOL]) +	return cmp1, call1  }  // eqmem returns the node  // 	memequal(&p.field, &q.field [, size])  func eqmem(p ir.Node, q ir.Node, field *types.Sym, size int64) ir.Node { -	nx := nodAddr(nodSym(ir.OXDOT, p, field)) -	ny := nodAddr(nodSym(ir.OXDOT, q, field)) -	nx = typecheck(nx, ctxExpr) -	ny = typecheck(ny, ctxExpr) +	nx := typecheck(nodAddr(nodSym(ir.OXDOT, p, field)), ctxExpr) +	ny := typecheck(nodAddr(nodSym(ir.OXDOT, q, field)), ctxExpr)  	fn, needsize := eqmemfunc(size, nx.Type().Elem())  	call := ir.Nod(ir.OCALL, fn, nil)  | 
