1
0
mirror of https://github.com/golang/go synced 2024-11-26 14:46:47 -07:00

cmd/compile: prune some deadcode around ODCLFUNC

An *ir.Func is always ODCLFUNC, so no need to double-check this
anymore. The type system statically ensures we have the right Op.

Also, pkginit.initRequiredForCoverage appears to be unused, so we can
get rid of it completely.

Change-Id: If1abb35672b40f705f23c365ad2a828c2661e9c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/520603
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Matthew Dempsky 2023-08-17 22:04:49 -07:00 committed by Gopher Robot
parent 3419a0aec1
commit 569def31fa
3 changed files with 0 additions and 24 deletions

View File

@ -125,12 +125,6 @@ func Funcs(all []*ir.Func) {
// Batch performs escape analysis on a minimal batch of
// functions.
func Batch(fns []*ir.Func, recursive bool) {
for _, fn := range fns {
if fn.Op() != ir.ODCLFUNC {
base.Fatalf("unexpected node: %v", fn)
}
}
var b batch
b.heapLoc.attrs = attrEscapes | attrPersists | attrMutates | attrCalls
b.mutatorLoc.attrs = attrMutates

View File

@ -199,18 +199,3 @@ func MakeTask() {
// It's not quite read only, the state field must be modifiable.
objw.Global(lsym, int32(ot), obj.NOPTR)
}
// initRequiredForCoverage returns TRUE if we need to force creation
// of an init function for the package so as to insert a coverage
// runtime registration call.
func initRequiredForCoverage(l []ir.Node) bool {
if base.Flag.Cfg.CoverageInfo == nil {
return false
}
for _, n := range l {
if n.Op() == ir.ODCLFUNC {
return true
}
}
return false
}

View File

@ -98,9 +98,6 @@ func (c *nowritebarrierrecChecker) findExtraCalls(nn ir.Node) {
default:
base.Fatalf("expected ONAME or OCLOSURE node, got %+v", arg)
}
if callee.Op() != ir.ODCLFUNC {
base.Fatalf("expected ODCLFUNC node, got %+v", callee)
}
c.extraCalls[c.curfn] = append(c.extraCalls[c.curfn], nowritebarrierrecCall{callee, n.Pos()})
}