Commit 92eb9aea authored by Robert Griesemer's avatar Robert Griesemer

go/types: move go/types/internal/gcimport => go/internal/gcimporter

This will make it possible to access the gcimporter (and gccgoimporter,
eventually) from the forthcoming gc/importer package, without exposing
compiler names in package names.

This change was created by manually adjusting the gcimporter paths in
go/types.bash and then running sh go/types.bash (i.e., by revendoring
gcimporter). The only manual changes are in go/types.bash.

Change-Id: Idc282439742288c09caa58b3a66d77aec0325faf
Reviewed-on: https://go-review.googlesource.com/8764Reviewed-by: default avatarRob Pike <r@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
parent 2539ccb8
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// Package gcimporter implements Import for gc-generated object files. // Package gcimporter implements Import for gc-generated object files.
// Importing this package installs Import as go/types.DefaultImport. // Importing this package installs Import as go/types.DefaultImport.
package gcimporter // import "go/types/internal/gcimporter" package gcimporter // import "go/internal/gcimporter"
import ( import (
"bufio" "bufio"
......
...@@ -40,7 +40,7 @@ function vendor() ( ...@@ -40,7 +40,7 @@ function vendor() (
# copy $f and update imports # copy $f and update imports
sed -e 's|"golang.org/x/tools/go/exact"|"go/exact"|' \ sed -e 's|"golang.org/x/tools/go/exact"|"go/exact"|' \
-e 's|"golang.org/x/tools/go/types"|"go/types"|' \ -e 's|"golang.org/x/tools/go/types"|"go/types"|' \
-e 's|"golang.org/x/tools/go/gcimporter"|"go/types/internal/gcimporter"|' \ -e 's|"golang.org/x/tools/go/gcimporter"|"go/internal/gcimporter"|' \
$f | gofmt > tmp.go $f | gofmt > tmp.go
mv -f tmp.go `basename $f` mv -f tmp.go `basename $f`
done done
...@@ -81,9 +81,9 @@ vendor go/types types ...@@ -81,9 +81,9 @@ vendor go/types types
install types install types
### go/gcimporter ### go/gcimporter
vendor go/gcimporter types/internal/gcimporter vendor go/gcimporter internal/gcimporter
test types/internal/gcimporter test internal/gcimporter
install types/internal/gcimporter install internal/gcimporter
### test go/types (requires gcimporter) ### test go/types (requires gcimporter)
test types test types
......
...@@ -122,7 +122,7 @@ type Config struct { ...@@ -122,7 +122,7 @@ type Config struct {
// DefaultImport is the default importer invoked if Config.Import == nil. // DefaultImport is the default importer invoked if Config.Import == nil.
// The declaration: // The declaration:
// //
// import _ "go/types/internal/gcimporter" // import _ "go/internal/gcimporter"
// //
// in a client of go/types will initialize DefaultImport to gcimporter.Import. // in a client of go/types will initialize DefaultImport to gcimporter.Import.
var DefaultImport Importer var DefaultImport Importer
......
...@@ -14,8 +14,8 @@ import ( ...@@ -14,8 +14,8 @@ import (
"strings" "strings"
"testing" "testing"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
// skipSpecialPlatforms causes the test to be skipped for platforms where // skipSpecialPlatforms causes the test to be skipped for platforms where
......
...@@ -10,8 +10,8 @@ import ( ...@@ -10,8 +10,8 @@ import (
"go/parser" "go/parser"
"testing" "testing"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
var builtinCalls = []struct { var builtinCalls = []struct {
......
...@@ -36,8 +36,8 @@ import ( ...@@ -36,8 +36,8 @@ import (
"strings" "strings"
"testing" "testing"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
var ( var (
......
...@@ -13,8 +13,8 @@ import ( ...@@ -13,8 +13,8 @@ import (
"strings" "strings"
"testing" "testing"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
func testEval(t *testing.T, pkg *Package, scope *Scope, str string, typ Type, typStr, valStr string) { func testEval(t *testing.T, pkg *Package, scope *Scope, str string, typ Type, typStr, valStr string) {
......
...@@ -14,8 +14,8 @@ import ( ...@@ -14,8 +14,8 @@ import (
"strings" "strings"
"testing" "testing"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
func TestIssue5770(t *testing.T) { func TestIssue5770(t *testing.T) {
......
...@@ -135,7 +135,7 @@ func (check *Checker) collectObjects() { ...@@ -135,7 +135,7 @@ func (check *Checker) collectObjects() {
} else { } else {
// Panic if we encounter an import. // Panic if we encounter an import.
importer = func(map[string]*Package, string) (*Package, error) { importer = func(map[string]*Package, string) (*Package, error) {
panic(`no Config.Import or DefaultImport (missing import _ "go/types/internal/gcimporter"?)`) panic(`no Config.Import or DefaultImport (missing import _ "go/internal/gcimporter"?)`)
} }
} }
} }
......
...@@ -12,8 +12,8 @@ import ( ...@@ -12,8 +12,8 @@ import (
"sort" "sort"
"testing" "testing"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
var sources = []string{ var sources = []string{
......
...@@ -14,8 +14,8 @@ import ( ...@@ -14,8 +14,8 @@ import (
"testing" "testing"
"time" "time"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
var benchmark = flag.Bool("b", false, "run benchmarks") var benchmark = flag.Bool("b", false, "run benchmarks")
......
...@@ -22,8 +22,8 @@ import ( ...@@ -22,8 +22,8 @@ import (
"testing" "testing"
"time" "time"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
var ( var (
......
...@@ -10,8 +10,8 @@ import ( ...@@ -10,8 +10,8 @@ import (
"go/token" "go/token"
"testing" "testing"
_ "go/internal/gcimporter"
. "go/types" . "go/types"
_ "go/types/internal/gcimporter"
) )
const filename = "<src>" const filename = "<src>"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment