]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/types/pkg.go
cmd/compile/internal/types: remove dead function
[gostls13.git] / src / cmd / compile / internal / types / pkg.go
index d77b92d2a36503a3f0853bc46b9acaf2af7cb0ad..c6ce7889afbb7bd7abc4d32a30e53278bda7b44f 100644 (file)
@@ -54,6 +54,10 @@ func NewPkg(path, name string) *Pkg {
        return p
 }
 
+func PkgMap() map[string]*Pkg {
+       return pkgMap
+}
+
 var nopkg = &Pkg{
        Syms: make(map[string]*Sym),
 }
@@ -102,6 +106,14 @@ func (pkg *Pkg) LookupNum(prefix string, n int) *Sym {
        return pkg.LookupBytes(b)
 }
 
+// Selector looks up a selector identifier.
+func (pkg *Pkg) Selector(name string) *Sym {
+       if IsExported(name) {
+               pkg = LocalPkg
+       }
+       return pkg.Lookup(name)
+}
+
 var (
        internedStringsmu sync.Mutex // protects internedStrings
        internedStrings   = map[string]string{}
@@ -117,12 +129,3 @@ func InternString(b []byte) string {
        internedStringsmu.Unlock()
        return s
 }
-
-// CleanroomDo invokes f in an environment with no preexisting packages.
-// For testing of import/export only.
-func CleanroomDo(f func()) {
-       saved := pkgMap
-       pkgMap = make(map[string]*Pkg)
-       f()
-       pkgMap = saved
-}