diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2023-10-04 15:22:49 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-10-05 15:20:28 +0000 |
| commit | 008dabcd19b5c3f00083c6d4e6c306682bb1bcd0 (patch) | |
| tree | 195eecd26805aa01cbe2f64b20514288f50acfcb /src/cmd/compile/internal/devirtualize | |
| parent | dcd018b5c54cd23b36ef732473f0d99fbb57f6fc (diff) | |
| download | go-008dabcd19b5c3f00083c6d4e6c306682bb1bcd0.tar.xz | |
cmd/compile/internal/ir: tweak a couple names
CallExpr.X -> CallExpr.Fun
This consistent with go/ast and cmd/compile/internal/syntax.
OPRINTN -> OPRINTLN
This op represents the "println" builtin; might as well spell it the
same way.
Change-Id: Iead1b007776658c717879cf0997b3c48028428f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/532795
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/devirtualize')
| -rw-r--r-- | src/cmd/compile/internal/devirtualize/devirtualize.go | 6 | ||||
| -rw-r--r-- | src/cmd/compile/internal/devirtualize/pgo.go | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/compile/internal/devirtualize/devirtualize.go b/src/cmd/compile/internal/devirtualize/devirtualize.go index 5e91104eeb..7b3a869d8e 100644 --- a/src/cmd/compile/internal/devirtualize/devirtualize.go +++ b/src/cmd/compile/internal/devirtualize/devirtualize.go @@ -51,7 +51,7 @@ func staticCall(call *ir.CallExpr) { if call.Op() != ir.OCALLINTER { return } - sel := call.X.(*ir.SelectorExpr) + sel := call.Fun.(*ir.SelectorExpr) r := ir.StaticValue(sel.X) if r.Op() != ir.OCONVIFACE { return @@ -120,14 +120,14 @@ func staticCall(call *ir.CallExpr) { base.WarnfAt(call.Pos(), "devirtualizing %v to %v", sel, typ) } call.SetOp(ir.OCALLMETH) - call.X = x + call.Fun = x case ir.ODOTINTER: // Promoted method from embedded interface-typed field (#42279). if base.Flag.LowerM != 0 { base.WarnfAt(call.Pos(), "partially devirtualizing %v to %v", sel, typ) } call.SetOp(ir.OCALLINTER) - call.X = x + call.Fun = x default: base.FatalfAt(call.Pos(), "failed to devirtualize %v (%v)", x, x.Op()) } diff --git a/src/cmd/compile/internal/devirtualize/pgo.go b/src/cmd/compile/internal/devirtualize/pgo.go index a04ff16d60..24d1634215 100644 --- a/src/cmd/compile/internal/devirtualize/pgo.go +++ b/src/cmd/compile/internal/devirtualize/pgo.go @@ -260,7 +260,7 @@ func constructCallStat(p *pgo.Profile, fn *ir.Func, name string, call *ir.CallEx case ir.OCALLFUNC: stat.Interface = false - callee := pgo.DirectCallee(call.X) + callee := pgo.DirectCallee(call.Fun) if callee != nil { stat.Direct = true if stat.Hottest == "" { @@ -283,7 +283,7 @@ func constructCallStat(p *pgo.Profile, fn *ir.Func, name string, call *ir.CallEx // concretetyp. func rewriteCondCall(call *ir.CallExpr, curfn, callee *ir.Func, concretetyp *types.Type) ir.Node { if base.Flag.LowerM != 0 { - fmt.Printf("%v: PGO devirtualizing %v to %v\n", ir.Line(call), call.X, callee) + fmt.Printf("%v: PGO devirtualizing %v to %v\n", ir.Line(call), call.Fun, callee) } // We generate an OINCALL of: @@ -316,13 +316,13 @@ func rewriteCondCall(call *ir.CallExpr, curfn, callee *ir.Func, concretetyp *typ var retvars []ir.Node - sig := call.X.Type() + sig := call.Fun.Type() for _, ret := range sig.Results() { retvars = append(retvars, typecheck.TempAt(base.Pos, curfn, ret.Type)) } - sel := call.X.(*ir.SelectorExpr) + sel := call.Fun.(*ir.SelectorExpr) method := sel.Sel pos := call.Pos() init := ir.TakeInit(call) @@ -421,7 +421,7 @@ func interfaceCallRecvTypeAndMethod(call *ir.CallExpr) (*types.Type, *types.Sym) base.Fatalf("Call isn't OCALLINTER: %+v", call) } - sel, ok := call.X.(*ir.SelectorExpr) + sel, ok := call.Fun.(*ir.SelectorExpr) if !ok { base.Fatalf("OCALLINTER doesn't contain SelectorExpr: %+v", call) } |
