cmd/compile/internal/types: remove Markdcl/Pushdcl/Popdcl

Sym.Def used to be used for symbol resolution during the
old (pre-types2) typechecker. But since moving to types2-based IR
construction, we haven't really had a need for Sym.Def to ever refer
to anything but the package-scope definition, because types2 handles
symbol resolution for us.

This CL finally removes the Markdcl/Pushdcl/Popdcl functions that have
been a recurring source of issues in the past.

Change-Id: I2b012a0f17203efdd724ebd1e9314bd128cc2d61
Reviewed-on: https://go-review.googlesource.com/c/go/+/458625
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
This commit is contained in:
Matthew Dempsky 2022-12-01 18:00:42 -08:00
parent f0b1563535
commit 13c70b12d7
6 changed files with 3 additions and 109 deletions

View file

@ -224,10 +224,6 @@ func genhash(t *types.Type) *obj.LSym {
typecheck.Stmts(fn.Body)
ir.CurFunc = nil
if base.Debug.DclStack != 0 {
types.CheckDclstack()
}
fn.SetNilCheckDisabled(true)
typecheck.Target.Decls = append(typecheck.Target.Decls, fn)
@ -552,10 +548,6 @@ func geneq(t *types.Type) *obj.LSym {
typecheck.Stmts(fn.Body)
ir.CurFunc = nil
if base.Debug.DclStack != 0 {
types.CheckDclstack()
}
// Disable checknils while compiling this code.
// We are comparing a struct or an array,
// neither of which can be nil, and our comparisons