diff options
author | Alan Donovan <adonovan@google.com> | 2015-01-21 14:13:33 -0500 |
---|---|---|
committer | Alan Donovan <adonovan@google.com> | 2015-01-21 22:21:01 +0000 |
commit | e079f6c63283585db69001a632951cc88c70b052 (patch) | |
tree | b13d3c919dedc300c36250b39065b5e9dd776b39 | |
parent | 4d45c8502056aca783c84cb9f5824c3301490945 (diff) | |
download | tools-e079f6c63283585db69001a632951cc88c70b052.tar.gz |
go/ssa: change import path of synthetic test package to "test$main"
...to avoid namespace conflicts.
Also make its name "main", since it defines func main().
And fix 2 typos.
Change-Id: I7cf7894d6bed134907b3d2742255e5a82426071b
Reviewed-on: https://go-review.googlesource.com/3150
Reviewed-by: Robert Griesemer <gri@golang.org>
-rw-r--r-- | cmd/callgraph/main_test.go | 6 | ||||
-rw-r--r-- | go/ssa/func.go | 2 | ||||
-rw-r--r-- | go/ssa/testmain.go | 2 | ||||
-rw-r--r-- | refactor/importgraph/graph.go | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/cmd/callgraph/main_test.go b/cmd/callgraph/main_test.go index 93ccb61..81fa490 100644 --- a/cmd/callgraph/main_test.go +++ b/cmd/callgraph/main_test.go @@ -40,13 +40,13 @@ func TestCallgraph(t *testing.T) { // tests: main is not called. {"rta", format, true, []string{ `pkg.Example --> (pkg.C).f`, - `testmain.init --> pkg.init`, + `test$main.init --> pkg.init`, }}, {"pta", format, true, []string{ `<root> --> pkg.Example`, - `<root> --> testmain.init`, + `<root> --> test$main.init`, `pkg.Example --> (pkg.C).f`, - `testmain.init --> pkg.init`, + `test$main.init --> pkg.init`, }}, } { stdout = new(bytes.Buffer) diff --git a/go/ssa/func.go b/go/ssa/func.go index 3f08d3e..621ec1d 100644 --- a/go/ssa/func.go +++ b/go/ssa/func.go @@ -426,7 +426,7 @@ func (f *Function) lookup(obj types.Object, escaping bool) Value { // Definition must be in an enclosing function; // plumb it through intervening closures. if f.parent == nil { - panic("no Value for type.Object " + obj.Name()) + panic("no ssa.Value for " + obj.String()) } outer := f.parent.lookup(obj, true) // escaping v := &FreeVar{ diff --git a/go/ssa/testmain.go b/go/ssa/testmain.go index ae9ec1c..a525c0b 100644 --- a/go/ssa/testmain.go +++ b/go/ssa/testmain.go @@ -100,7 +100,7 @@ func (prog *Program) CreateTestMainPackage(pkgs ...*Package) *Package { Prog: prog, Members: make(map[string]Member), values: make(map[types.Object]Value), - Object: types.NewPackage("testmain", "testmain"), + Object: types.NewPackage("test$main", "main"), } // Build package's init function. diff --git a/refactor/importgraph/graph.go b/refactor/importgraph/graph.go index 6f49fab..df73e23 100644 --- a/refactor/importgraph/graph.go +++ b/refactor/importgraph/graph.go @@ -51,7 +51,7 @@ func (g Graph) Search(roots ...string) map[string]bool { return seen } -// Builds scans the specified Go workspace and builds the forward and +// Build scans the specified Go workspace and builds the forward and // reverse import dependency graphs for all its packages. // It also returns a mapping from import paths to errors for packages // that could not be loaded. |