cmd/compile: remove go:notinheap pragma

Updates #46731

Change-Id: I247fa9c7ca97feb9053665da7ff56e7f5b571f74
Reviewed-on: https://go-review.googlesource.com/c/go/+/422815
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
This commit is contained in:
Cuong Manh Le 2022-08-10 20:01:48 +07:00
parent 0ee0bb1003
commit 8bbb362f4c
9 changed files with 7 additions and 54 deletions

View file

@ -1096,9 +1096,6 @@ func (r *reader) typeExt(name *ir.Name) {
}
name.SetPragma(r.pragmaFlag())
if name.Pragma()&ir.NotInHeap != 0 {
typ.SetNotInHeap(true)
}
typecheck.SetBaseTypeIndex(typ, r.Int64(), r.Int64())
}
@ -2440,16 +2437,6 @@ func (r *reader) expr() (res ir.Node) {
// TODO(mdempsky): Stop constructing expressions of untyped type.
x = typecheck.DefaultLit(x, typ)
if op, why := typecheck.Convertop(x.Op() == ir.OLITERAL, x.Type(), typ); op == ir.OXXX {
// types2 ensured that x is convertable to typ under standard Go
// semantics, but cmd/compile also disallows some conversions
// involving //go:notinheap.
//
// TODO(mdempsky): This can be removed after #46731 is implemented.
base.ErrorfAt(pos, "cannot convert %L to type %v%v", x, typ, why)
base.ErrorExit() // harsh, but prevents constructing invalid IR
}
ce := ir.NewConvExpr(pos, ir.OCONV, typ, x)
ce.TypeWord, ce.SrcRType = typeWord, srcRType
if implicit {