diff --git a/compiler/cl/builtin_test.go b/compiler/cl/builtin_test.go index 43660fb4..657bc6b2 100644 --- a/compiler/cl/builtin_test.go +++ b/compiler/cl/builtin_test.go @@ -329,12 +329,6 @@ func TestIntVal(t *testing.T) { intVal(&ssa.Parameter{}) } -func TestIgnoreName(t *testing.T) { - if !ignoreName("runtime/foo") || !ignoreName("internal/abi") { - t.Fatal("ignoreName failed") - } -} - func TestErrImport(t *testing.T) { var ctx context pkg := types.NewPackage("foo", "foo") diff --git a/compiler/cl/compile.go b/compiler/cl/compile.go index cec8e95e..245e704c 100644 --- a/compiler/cl/compile.go +++ b/compiler/cl/compile.go @@ -135,9 +135,6 @@ func (p *context) compileType(pkg llssa.Package, t *ssa.Type) { tnName := tn.Name() typ := tn.Type() name := llssa.FullName(tn.Pkg(), tnName) - if ignoreName(name) { - return - } if debugInstr { log.Println("==> NewType", name, typ) } @@ -160,7 +157,7 @@ func (p *context) compileMethods(pkg llssa.Package, typ types.Type) { func (p *context) compileGlobal(pkg llssa.Package, gbl *ssa.Global) { typ := globalType(gbl) name, vtype, define := p.varName(gbl.Pkg.Pkg, gbl) - if vtype == pyVar || ignoreName(name) { + if vtype == pyVar { return } if debugInstr { diff --git a/compiler/cl/import.go b/compiler/cl/import.go index 179a0de1..68dea8e2 100644 --- a/compiler/cl/import.go +++ b/compiler/cl/import.go @@ -516,9 +516,6 @@ func (p *context) funcName(fn *ssa.Function, ignore bool) (*types.Package, strin } p.ensureLoaded(pkg) orgName = funcName(pkg, fn, false) - if ignore && ignoreName(orgName) { - return nil, orgName, ignoredFunc - } } if v, ok := p.prog.Linkname(orgName); ok { if strings.HasPrefix(v, "C.") { @@ -671,23 +668,4 @@ func replaceGoName(v string, pos int) string { return v } -func ignoreName(name string) bool { - /* TODO(xsw): confirm this is not needed more - if name == "unsafe.init" { - return true - } - */ - const internal = "internal/" - return (strings.HasPrefix(name, internal) && !supportedInternal(name[len(internal):])) || - strings.HasPrefix(name, "runtime/") || strings.HasPrefix(name, "arena.") || - strings.HasPrefix(name, "maps.") || strings.HasPrefix(name, "plugin.") -} - -func supportedInternal(name string) bool { - return strings.HasPrefix(name, "abi.") || strings.HasPrefix(name, "bytealg.") || - strings.HasPrefix(name, "itoa.") || strings.HasPrefix(name, "oserror.") || strings.HasPrefix(name, "race.") || - strings.HasPrefix(name, "reflectlite.") || strings.HasPrefix(name, "stringslite.") || strings.HasPrefix(name, "filepathlite.") || - strings.HasPrefix(name, "syscall/unix.") || strings.HasPrefix(name, "syscall/execenv.") -} - // ----------------------------------------------------------------------------- diff --git a/compiler/internal/build/build.go b/compiler/internal/build/build.go index ea1bee79..e03f535a 100644 --- a/compiler/internal/build/build.go +++ b/compiler/internal/build/build.go @@ -854,13 +854,7 @@ func canSkipToBuild(pkgPath string) bool { if _, ok := hasAltPkg[pkgPath]; ok { return false } - switch pkgPath { - case "unsafe": - return true - default: - return strings.HasPrefix(pkgPath, "internal/") || - strings.HasPrefix(pkgPath, "runtime/internal/") - } + return pkgPath == "unsafe" } // findDylibDep finds the dylib dependency in the executable. It returns empty