This method is only used to find the path of the function being
compiled for hash debugging, but it was instead returning the path of
the package being compiled. These are typically the same, but can be
different for certain functions compiled across package boundaries
(e.g., method value wrappers and generic functions).
It's redundant either with f.fe.Func().Sym().Pkg.Path (package path of
the function being compiled) or f.Config.ctxt.Pkgpath (package path of
the compilation unit), so just remove it instead.
Change-Id: I1daae09055043d0ecb1fcc874a0b0006a6f8bddf
Reviewed-on: https://go-review.googlesource.com/c/go/+/526516
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
// UseWriteBarrier reports whether write barrier is enabled
UseWriteBarrier() bool
- // MyImportPath provides the import name (roughly, the package) for the function being compiled.
- MyImportPath() string
-
// Func returns the ir.Func of the function being compiled.
Func() *ir.Func
}
func (d TestFrontend) Warnl(_ src.XPos, msg string, args ...interface{}) { d.t.Logf(msg, args...) }
func (d TestFrontend) Debug_checknil() bool { return false }
-func (d TestFrontend) MyImportPath() string {
- return d.f.Sym().Pkg.Path
-}
func (d TestFrontend) Func() *ir.Func {
return d.f
}
if !base.HasDebugHash() {
return true
}
- return base.DebugHashMatchPkgFunc(f.fe.MyImportPath(), f.Name)
+ sym := f.fe.Func().Sym()
+ return base.DebugHashMatchPkgFunc(sym.Pkg.Path, sym.Name)
}
func (f *Func) spSb() (sp, sb *Value) {
return nil
}
-func (e *ssafn) MyImportPath() string {
- return base.Ctxt.Pkgpath
-}
-
func (e *ssafn) Func() *ir.Func {
return e.curfn
}