mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +00:00
[dev.unified] cmd/compile: export/import implicit attribute for conversion exprs
So they can be formatted more presicely, and make it easier in the transition to Unified IR. Updates #53058 Change-Id: I8b5a46db05a2e2822289458995b8653f0a3ffbbe Reviewed-on: https://go-review.googlesource.com/c/go/+/410594 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
a8780f94c3
commit
46ddf0873e
|
@ -1978,6 +1978,7 @@ func (w *exportWriter) expr(n ir.Node) {
|
|||
w.pos(n.Pos())
|
||||
w.typ(n.Type())
|
||||
w.expr(n.X)
|
||||
w.bool(n.Implicit())
|
||||
|
||||
case ir.OREAL, ir.OIMAG, ir.OCAP, ir.OCLOSE, ir.OLEN, ir.ONEW, ir.OPANIC:
|
||||
n := n.(*ir.UnaryExpr)
|
||||
|
|
|
@ -1489,7 +1489,9 @@ func (r *importReader) node() ir.Node {
|
|||
return n
|
||||
|
||||
case ir.OCONV, ir.OCONVIFACE, ir.OCONVIDATA, ir.OCONVNOP, ir.OBYTES2STR, ir.ORUNES2STR, ir.OSTR2BYTES, ir.OSTR2RUNES, ir.ORUNESTR, ir.OSLICE2ARRPTR:
|
||||
return ir.NewConvExpr(r.pos(), op, r.typ(), r.expr())
|
||||
n := ir.NewConvExpr(r.pos(), op, r.typ(), r.expr())
|
||||
n.SetImplicit(r.bool())
|
||||
return n
|
||||
|
||||
case ir.OCOPY, ir.OCOMPLEX, ir.OREAL, ir.OIMAG, ir.OAPPEND, ir.OCAP, ir.OCLOSE, ir.ODELETE, ir.OLEN, ir.OMAKE, ir.ONEW, ir.OPANIC, ir.ORECOVER, ir.OPRINT, ir.OPRINTN, ir.OUNSAFEADD, ir.OUNSAFESLICE:
|
||||
pos := r.pos()
|
||||
|
|
|
@ -7,7 +7,7 @@ package b
|
|||
import "./a"
|
||||
|
||||
func g() {
|
||||
h := a.E() // ERROR "inlining call to a.E" "a.I\(a.T\(0\)\) does not escape"
|
||||
h := a.E() // ERROR "inlining call to a.E" "T\(0\) does not escape"
|
||||
h.M() // ERROR "devirtualizing h.M to a.T"
|
||||
|
||||
// BAD: T(0) could be stack allocated.
|
||||
|
|
|
@ -1998,7 +1998,6 @@ var unifiedFailures = setOf(
|
|||
"inline.go", // unified IR reports function literal diagnostics on different lines than -d=inlfuncswithclosures
|
||||
"linkname3.go", // unified IR is missing some linkname errors
|
||||
|
||||
"fixedbugs/issue42284.go", // prints "T(0) does not escape", but test expects "a.I(a.T(0)) does not escape"
|
||||
"fixedbugs/issue7921.go", // prints "… escapes to heap", but test expects "string(…) escapes to heap"
|
||||
"typeparam/issue47631.go", // unified IR can handle local type declarations
|
||||
"fixedbugs/issue42058a.go", // unified IR doesn't report channel element too large
|
||||
|
|
Loading…
Reference in a new issue