1
0
mirror of https://github.com/golang/go synced 2024-09-29 14:14:29 -06:00

cmd/compile: remove inTypeCheckInl boolean

After CL 402974, we do not typecheck an inline body in ImportedBody
anymore, thus the inTypeCheckInl check is un-necessary.

Change-Id: Ia6154a57db507c3e00b67333f1e3b910a6de7d05
Reviewed-on: https://go-review.googlesource.com/c/go/+/402975
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
This commit is contained in:
Cuong Manh Le 2022-04-29 01:20:38 +07:00 committed by Gopher Robot
parent 15381040fa
commit 96a1ad298a

View File

@ -137,11 +137,6 @@ func MethodValueType(n *ir.SelectorExpr) *types.Type {
return t
}
// True if we are typechecking an inline body in ImportedBody below. We use this
// flag to not create a new closure function in tcClosure when we are just
// typechecking an inline body, as opposed to the body of a real function.
var inTypeCheckInl bool
// ImportedBody returns immediately if the inlining information for fn is
// populated. Otherwise, fn must be an imported function. If so, ImportedBody
// loads in the dcls and body for fn, and typechecks as needed.
@ -263,15 +258,7 @@ func tcClosure(clo *ir.ClosureExpr, top int) ir.Node {
clo.SetType(fn.Type())
target := Target
if inTypeCheckInl {
// We're typechecking an imported function, so it's not actually
// part of Target. Skip adding it to Target.Decls so we don't
// compile it again.
target = nil
}
return ir.UseClosure(clo, target)
return ir.UseClosure(clo, Target)
}
// type check function definition