diff options
| author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2022-08-10 20:01:48 +0700 |
|---|---|---|
| committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2022-09-02 18:24:59 +0000 |
| commit | 8bbb362f4c954da7c521bf2dd34b22fa3e5ab3c5 (patch) | |
| tree | 2f1fe6f6e21cf16067f81887e591ae15a0445091 /src/cmd/compile/internal/noder/decl.go | |
| parent | 0ee0bb1003aa96a8ed94728784bb7faa301702d9 (diff) | |
| download | go-8bbb362f4c954da7c521bf2dd34b22fa3e5ab3c5.tar.xz | |
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>
Diffstat (limited to 'src/cmd/compile/internal/noder/decl.go')
| -rw-r--r-- | src/cmd/compile/internal/noder/decl.go | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/cmd/compile/internal/noder/decl.go b/src/cmd/compile/internal/noder/decl.go index 91a90d9e09..07353cc17e 100644 --- a/src/cmd/compile/internal/noder/decl.go +++ b/src/cmd/compile/internal/noder/decl.go @@ -212,33 +212,9 @@ func (g *irgen) typeDecl(out *ir.Nodes, decl *syntax.TypeDecl) { ntyp.SetVargen() } - pragmas := g.pragmaFlags(decl.Pragma, typePragmas) + pragmas := g.pragmaFlags(decl.Pragma, 0) name.SetPragma(pragmas) // TODO(mdempsky): Is this still needed? - if pragmas&ir.NotInHeap != 0 { - ntyp.SetNotInHeap(true) - } - - // We need to use g.typeExpr(decl.Type) here to ensure that for - // chained, defined-type declarations like: - // - // type T U - // - // //go:notinheap - // type U struct { … } - // - // we mark both T and U as NotInHeap. If we instead used just - // g.typ(otyp.Underlying()), then we'd instead set T's underlying - // type directly to the struct type (which is not marked NotInHeap) - // and fail to mark T as NotInHeap. - // - // Also, we rely here on Type.SetUnderlying allowing passing a - // defined type and handling forward references like from T to U - // above. Contrast with go/types's Named.SetUnderlying, which - // disallows this. - // - // [mdempsky: Subtleties like these are why I always vehemently - // object to new type pragmas.] ntyp.SetUnderlying(g.typeExpr(decl.Type)) tparams := otyp.(*types2.Named).TypeParams() |
