runtime: rm ignoreName
This commit is contained in:
@@ -329,12 +329,6 @@ func TestIntVal(t *testing.T) {
|
|||||||
intVal(&ssa.Parameter{})
|
intVal(&ssa.Parameter{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIgnoreName(t *testing.T) {
|
|
||||||
if !ignoreName("runtime/foo.bar") || ignoreName("internal/abi.Type") {
|
|
||||||
t.Fatal("ignoreName failed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestErrImport(t *testing.T) {
|
func TestErrImport(t *testing.T) {
|
||||||
var ctx context
|
var ctx context
|
||||||
pkg := types.NewPackage("foo", "foo")
|
pkg := types.NewPackage("foo", "foo")
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import (
|
|||||||
|
|
||||||
"github.com/goplus/llgo/compiler/internal/env"
|
"github.com/goplus/llgo/compiler/internal/env"
|
||||||
llssa "github.com/goplus/llgo/compiler/ssa"
|
llssa "github.com/goplus/llgo/compiler/ssa"
|
||||||
llruntime "github.com/goplus/llgo/runtime"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -669,8 +668,4 @@ func replaceGoName(v string, pos int) string {
|
|||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
func ignoreName(name string) bool {
|
|
||||||
return llruntime.IgnoreName(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -20,24 +20,6 @@ func SkipToBuild(pkgPath string) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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) && !IsSupportedInternal(name)) ||
|
|
||||||
strings.HasPrefix(name, "runtime/") || strings.HasPrefix(name, "arena.") ||
|
|
||||||
strings.HasPrefix(name, "maps.") || strings.HasPrefix(name, "plugin.")
|
|
||||||
}
|
|
||||||
|
|
||||||
func IsSupportedInternal(name string) (b bool) {
|
|
||||||
paths := strings.Split(name, ".")
|
|
||||||
_, b = supportedInternal[paths[0]]
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func HasAltPkg(path string) (b bool) {
|
func HasAltPkg(path string) (b bool) {
|
||||||
_, b = hasAltPkg[path]
|
_, b = hasAltPkg[path]
|
||||||
return
|
return
|
||||||
@@ -53,11 +35,15 @@ var hasAltPkg = map[string]none{
|
|||||||
"crypto/sha256": {},
|
"crypto/sha256": {},
|
||||||
"crypto/sha512": {},
|
"crypto/sha512": {},
|
||||||
"crypto/subtle": {},
|
"crypto/subtle": {},
|
||||||
|
"go/parser": {},
|
||||||
"hash/crc32": {},
|
"hash/crc32": {},
|
||||||
"internal/abi": {},
|
"internal/abi": {},
|
||||||
"internal/bytealg": {},
|
"internal/bytealg": {},
|
||||||
|
"internal/cpu": {},
|
||||||
"internal/itoa": {},
|
"internal/itoa": {},
|
||||||
|
"internal/godebug": {},
|
||||||
"internal/oserror": {},
|
"internal/oserror": {},
|
||||||
|
"internal/poll": {},
|
||||||
"internal/reflectlite": {},
|
"internal/reflectlite": {},
|
||||||
"internal/syscall/execenv": {},
|
"internal/syscall/execenv": {},
|
||||||
"internal/syscall/unix": {},
|
"internal/syscall/unix": {},
|
||||||
@@ -72,20 +58,18 @@ var hasAltPkg = map[string]none{
|
|||||||
"time": {},
|
"time": {},
|
||||||
"os": {},
|
"os": {},
|
||||||
"os/exec": {},
|
"os/exec": {},
|
||||||
|
"os/signal": {},
|
||||||
"runtime": {},
|
"runtime": {},
|
||||||
|
"runtime/debug": {},
|
||||||
|
"runtime/pprof": {},
|
||||||
|
"runtime/trace": {},
|
||||||
|
"runtime/internal/syscall": {},
|
||||||
"io": {},
|
"io": {},
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportedInternal = map[string]none{
|
var supportedInternal = map[string]none{
|
||||||
"internal/abi": {},
|
"internal/race": {},
|
||||||
"internal/bytealg": {},
|
"internal/stringslite": {},
|
||||||
"internal/itoa": {},
|
"internal/filepathlite": {},
|
||||||
"internal/oserror": {},
|
"internal/fmtsort": {},
|
||||||
"internal/race": {},
|
|
||||||
"internal/reflectlite": {},
|
|
||||||
"internal/stringslite": {},
|
|
||||||
"internal/filepathlite": {},
|
|
||||||
"internal/syscall/unix": {},
|
|
||||||
"internal/syscall/execenv": {},
|
|
||||||
"internal/fmtsort": {},
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user