mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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>
This commit is contained in:
parent
fa06894b36
commit
5ae70b85c6
11 changed files with 126 additions and 191 deletions
|
|
@ -654,9 +654,7 @@ func (s *typeSwitch) Add(pos src.XPos, typ *types.Type, caseVar, jmp ir.Node) {
|
|||
dot := ir.NodAt(pos, ir.ODOTTYPE, s.facename, nil)
|
||||
dot.SetType(typ) // iface.(type)
|
||||
as.PtrRlist().Set1(dot)
|
||||
as = typecheck(as, ctxStmt)
|
||||
as = walkexpr(as, &body)
|
||||
body.Append(as)
|
||||
appendWalkStmt(&body, as)
|
||||
|
||||
// if ok { goto label }
|
||||
nif := ir.NodAt(pos, ir.OIF, nil, nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue