diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2022-02-28 15:31:35 -0800 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2022-03-01 19:46:09 +0000 |
| commit | d6d2ebb7b8194eb20d95b84bae39f7a5837e9f72 (patch) | |
| tree | bec3a10b32da3210bf10e697089bdfc976766e32 /src/cmd/compile/internal/ir/node.go | |
| parent | 0fcb94895fa3efd9733e5ab66f5634f92cee9aa3 (diff) | |
| download | go-d6d2ebb7b8194eb20d95b84bae39f7a5837e9f72.tar.xz | |
cmd/compile/internal/ir: remove unused -G=0 node types
ir.PkgName was only used by the old -G=0 frontend for representing
identifiers that refer to a package name. The new types2-based
frontends directly resolve the qualified identifier to the respective
object during IR construction.
Similarly, most of the ir.*Type nodes were only needed for
representing types in the IR prior to type checking. The new
types2-based frontends directly construct the corresponding types.Type
instead.
Exception: The internal typecheck.DeclFunc API used for
compiler-generated functions still depends on ir.FuncType, so that IR
node type is retained for now. (Eventually, we should update
typecheck.DeclFunc and callers to not depend on it, but it's not
urgent.)
Change-Id: I982f1bbd41eef5b42ce0f32676c7dc4a8ab6d0ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/388538
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ir/node.go')
| -rw-r--r-- | src/cmd/compile/internal/ir/node.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/cmd/compile/internal/ir/node.go b/src/cmd/compile/internal/ir/node.go index 5fdccf8927..e4cff85136 100644 --- a/src/cmd/compile/internal/ir/node.go +++ b/src/cmd/compile/internal/ir/node.go @@ -118,7 +118,6 @@ const ( // Also used for a qualified package identifier that hasn't been resolved yet. ONONAME OTYPE // type name - OPACK // import OLITERAL // literal ONIL // nil @@ -291,15 +290,10 @@ const ( OFUNCINST // instantiation of a generic function // types - OTCHAN // chan int - OTMAP // map[string]int - OTSTRUCT // struct{} - OTINTER // interface{} // OTFUNC: func() - Recv is receiver field, Params is list of param fields, Results is // list of result fields. + // TODO(mdempsky): Remove. OTFUNC - OTARRAY // [8]int or [...]int - OTSLICE // []int // misc // intermediate representation of an inlined call. Uses Init (assignments @@ -533,7 +527,7 @@ func HasNamedResults(fn *Func) bool { // their usage position. func HasUniquePos(n Node) bool { switch n.Op() { - case ONAME, OPACK: + case ONAME: return false case OLITERAL, ONIL, OTYPE: if n.Sym() != nil { |
