]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove unused importimport function
authorRobert Griesemer <gri@golang.org>
Wed, 24 Aug 2016 20:12:34 +0000 (13:12 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 24 Aug 2016 20:28:21 +0000 (20:28 +0000)
Functionality is present in bimport.go in slightly modified form.

Change-Id: I6be79d91588873e6ba70d6ab07ba2caa12346dfc
Reviewed-on: https://go-review.googlesource.com/27672
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/export.go

index 65c845c93ad1509286efcf5e37b597f96de8451a..ff7ea418d1ad5a2b31ef485b4a2d8724987fcf01 100644 (file)
@@ -212,6 +212,12 @@ func (p *importer) verifyTypes() {
        }
 }
 
+// numImport tracks how often a package with a given name is imported.
+// It is used to provide a better error message (by using the package
+// path to disambiguate) if a package that appears multiple times with
+// the same name appears in an error message.
+var numImport = make(map[string]int)
+
 func (p *importer) pkg() *Pkg {
        // if the package was seen before, i is its index (>= 0)
        i := p.tagOrIndex()
@@ -244,7 +250,7 @@ func (p *importer) pkg() *Pkg {
                Fatalf("importer: package path %q for pkg index %d", path, len(p.pkgList))
        }
 
-       // see importimport (export.go)
+       // add package to pkgList
        pkg := importpkg
        if path != "" {
                pkg = mkpkg(path)
index 3da93d583210f1f6c119f172dd52bb677a08c54a..b982009cef44d611ebe9d603100f3597cea40e1e 100644 (file)
@@ -295,34 +295,6 @@ func pkgtype(s *Sym) *Type {
        return s.Def.Type
 }
 
-// numImport tracks how often a package with a given name is imported.
-// It is used to provide a better error message (by using the package
-// path to disambiguate) if a package that appears multiple times with
-// the same name appears in an error message.
-var numImport = make(map[string]int)
-
-func importimport(s *Sym, path string) {
-       // Informational: record package name
-       // associated with import path, for use in
-       // human-readable messages.
-
-       if isbadimport(path) {
-               errorexit()
-       }
-       p := mkpkg(path)
-       if p.Name == "" {
-               p.Name = s.Name
-               numImport[s.Name]++
-       } else if p.Name != s.Name {
-               Yyerror("conflicting names %s and %s for package %q", p.Name, s.Name, p.Path)
-       }
-
-       if incannedimport == 0 && myimportpath != "" && path == myimportpath {
-               Yyerror("import %q: package depends on %q (import cycle)", importpkg.Path, path)
-               errorexit()
-       }
-}
-
 // importconst declares symbol s as an imported constant with type t and value n.
 func importconst(s *Sym, t *Type, n *Node) {
        importsym(s, OLITERAL)