diff --git a/src/cmd/compile/internal/pkginit/init.go b/src/cmd/compile/internal/pkginit/init.go index 67942c37c0..8c60e3bfd6 100644 --- a/src/cmd/compile/internal/pkginit/init.go +++ b/src/cmd/compile/internal/pkginit/init.go @@ -169,7 +169,7 @@ func Task() *ir.Name { fns = append(fns, fn.Nname.Linksym()) } - if len(deps) == 0 && len(fns) == 0 && types.LocalPkg.Name != "main" && types.LocalPkg.Name != "runtime" { + if len(deps) == 0 && len(fns) == 0 && types.LocalPkg.Path != "main" && types.LocalPkg.Path != "runtime" { return nil // nothing to initialize } diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index c4f9994104..a7778d37fb 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -4760,9 +4760,6 @@ func findIntrinsic(sym *types.Sym) intrinsicBuilder { return nil } pkg := sym.Pkg.Path - if sym.Pkg == types.LocalPkg { - pkg = base.Ctxt.Pkgpath - } if sym.Pkg == ir.Pkgs.Runtime { pkg = "runtime" } diff --git a/src/cmd/compile/internal/staticdata/embed.go b/src/cmd/compile/internal/staticdata/embed.go index 48eaa07a5e..8d4dedff59 100644 --- a/src/cmd/compile/internal/staticdata/embed.go +++ b/src/cmd/compile/internal/staticdata/embed.go @@ -67,7 +67,7 @@ func embedFileList(v *ir.Name, kind int) []string { // embedKind determines the kind of embedding variable. func embedKind(typ *types.Type) int { - if typ.Sym() != nil && typ.Sym().Name == "FS" && (typ.Sym().Pkg.Path == "embed" || (typ.Sym().Pkg == types.LocalPkg && base.Ctxt.Pkgpath == "embed")) { + if typ.Sym() != nil && typ.Sym().Name == "FS" && typ.Sym().Pkg.Path == "embed" { return embedFiles } if typ.Kind() == types.TSTRING { diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 2ec4f05c55..1ea239ea32 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -2088,9 +2088,6 @@ func IsRuntimePkg(p *Pkg) bool { // IsReflectPkg reports whether p is package reflect. func IsReflectPkg(p *Pkg) bool { - if p == LocalPkg { - return base.Ctxt.Pkgpath == "reflect" - } return p.Path == "reflect" }