зеркало из https://github.com/golang/tools.git
go.tools: rename packages.
Was: Now: ssa go/ssa importer go/loader pointer go/pointer Next CL: call -> go/callgraph (requires more care) R=gri, crawshaw CC=golang-codereviews https://golang.org/cl/52960043
This commit is contained in:
Родитель
d20cbc12f1
Коммит
3fc0fc1310
|
@ -54,7 +54,7 @@ import (
|
|||
//
|
||||
// Precondition: [start, end) both lie within the same file as root.
|
||||
// TODO(adonovan): return (nil, false) in this case and remove precond.
|
||||
// Requires FileSet; see importer.tokenFileContainsPos.
|
||||
// Requires FileSet; see loader.tokenFileContainsPos.
|
||||
//
|
||||
// Postcondition: path is never nil; it always contains at least 'root'.
|
||||
//
|
||||
|
|
|
@ -58,7 +58,7 @@ language.
|
|||
*/
|
||||
package call
|
||||
|
||||
import "code.google.com/p/go.tools/ssa"
|
||||
import "code.google.com/p/go.tools/go/ssa"
|
||||
|
||||
// A Graph represents a call graph.
|
||||
//
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
"runtime"
|
||||
"runtime/pprof"
|
||||
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/oracle"
|
||||
)
|
||||
|
||||
|
@ -74,7 +74,7 @@ Describe the syntax at offset 530 in this file (an import spec):
|
|||
|
||||
Print the callgraph of the trivial web-server in JSON format:
|
||||
% oracle -format=json src/pkg/net/http/triv.go callgraph
|
||||
` + importer.FromArgsUsage
|
||||
` + loader.FromArgsUsage
|
||||
|
||||
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ import (
|
|||
"runtime"
|
||||
"runtime/pprof"
|
||||
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/ssa/interp"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/ssa/interp"
|
||||
)
|
||||
|
||||
var buildFlag = flag.String("build", "", `Options controlling the SSA builder.
|
||||
|
@ -48,7 +48,7 @@ Examples:
|
|||
% ssadump -build=FPG hello.go # quickly dump SSA form of a single package
|
||||
% ssadump -run -interp=T hello.go # interpret a program, with tracing
|
||||
% ssadump -run unicode -- -test.v # interpret the unicode package's tests, verbosely
|
||||
` + importer.FromArgsUsage +
|
||||
` + loader.FromArgsUsage +
|
||||
`
|
||||
When -run is specified, ssadump will find the first package that
|
||||
defines a main function and run it in the interpreter.
|
||||
|
@ -73,7 +73,7 @@ func main() {
|
|||
flag.Parse()
|
||||
args := flag.Args()
|
||||
|
||||
conf := importer.Config{
|
||||
conf := loader.Config{
|
||||
Build: &build.Default,
|
||||
SourceImports: true,
|
||||
}
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package importer_test
|
||||
package loader_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
)
|
||||
|
||||
func loadFromArgs(args []string) (prog *importer.Program, rest []string, err error) {
|
||||
conf := &importer.Config{}
|
||||
func loadFromArgs(args []string) (prog *loader.Program, rest []string, err error) {
|
||||
conf := &loader.Config{}
|
||||
rest, err = conf.FromArgs(args)
|
||||
if err == nil {
|
||||
prog, err = conf.Load()
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package importer loads, parses and type-checks packages of Go code
|
||||
// Package loader loads, parses and type-checks packages of Go code
|
||||
// plus their transitive closure, and retains both the ASTs and the
|
||||
// derived facts.
|
||||
//
|
||||
|
@ -18,7 +18,7 @@
|
|||
// be called any number of times. Finally, these are followed by a
|
||||
// call to Load() to actually load and type-check the program.
|
||||
//
|
||||
// var conf importer.Config
|
||||
// var conf loader.Config
|
||||
//
|
||||
// // Use the command-line arguments to specify
|
||||
// // a set of initial packages to load from source.
|
||||
|
@ -70,7 +70,7 @@
|
|||
// An external test package may depend upon members of the augmented
|
||||
// package that are not in the unaugmented package, such as functions
|
||||
// that expose internals. (See bufio/export_test.go for an example.)
|
||||
// So, the importer must ensure that for each external test package
|
||||
// So, the loader must ensure that for each external test package
|
||||
// it loads, it also augments the corresponding non-test package.
|
||||
//
|
||||
// The import graph over n unaugmented packages must be acyclic; the
|
||||
|
@ -78,17 +78,16 @@
|
|||
// package must also be acyclic. ('go test' relies on this.) But the
|
||||
// import graph over n augmented packages may contain cycles, and
|
||||
// currently, go/types is incapable of handling such inputs, so the
|
||||
// Importer will only augment (and create an external test package
|
||||
// loader will only augment (and create an external test package
|
||||
// for) the first import path specified on the command-line.
|
||||
//
|
||||
// The INITIAL packages are those specified in the configuration. A
|
||||
// DEPENDENCY is a package loaded to satisfy an import in an initial
|
||||
// package or another dependency.
|
||||
//
|
||||
package importer
|
||||
package loader
|
||||
|
||||
// TODO(adonovan):
|
||||
// - Rename this package go.tools/go/loader.
|
||||
// - (*Config).ParseFile is very handy, but feels like feature creep.
|
||||
// (*Config).CreateFromFiles has a nasty precondition.
|
||||
// - Ideally some of this logic would move under the umbrella of
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package importer
|
||||
package loader
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package importer_test
|
||||
package loader_test
|
||||
|
||||
// This file defines tests of source utilities.
|
||||
|
||||
|
@ -14,8 +14,8 @@ import (
|
|||
"testing"
|
||||
|
||||
"code.google.com/p/go.tools/astutil"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
)
|
||||
|
||||
// findInterval parses input and returns the [start, end) positions of
|
||||
|
@ -82,7 +82,7 @@ func TestEnclosingFunction(t *testing.T) {
|
|||
"900", "func@2.27"},
|
||||
}
|
||||
for _, test := range tests {
|
||||
conf := importer.Config{Fset: token.NewFileSet()}
|
||||
conf := loader.Config{Fset: token.NewFileSet()}
|
||||
f, start, end := findInterval(t, conf.Fset, test.input, test.substr)
|
||||
if f == nil {
|
||||
continue
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package importer
|
||||
package loader
|
||||
|
||||
// This file defines various utility functions exposed by the package
|
||||
// and used by it.
|
|
@ -13,9 +13,9 @@ import (
|
|||
"os"
|
||||
"reflect"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/go/types/typemap"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// object.flags bitmask values.
|
|
@ -11,8 +11,8 @@ import (
|
|||
"io"
|
||||
|
||||
"code.google.com/p/go.tools/call"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types/typemap"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// A Config formulates a pointer analysis problem for Analyze().
|
|
@ -11,7 +11,7 @@ import (
|
|||
"go/token"
|
||||
|
||||
"code.google.com/p/go.tools/call"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
)
|
||||
|
||||
// cgraph implements call.Graph.
|
|
@ -9,9 +9,9 @@ import (
|
|||
"sort"
|
||||
|
||||
"code.google.com/p/go.tools/call"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/pointer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/pointer"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
)
|
||||
|
||||
// This program demonstrates how to use the pointer analysis to
|
||||
|
@ -38,8 +38,8 @@ func main() {
|
|||
i.f() // dynamic method call
|
||||
}
|
||||
`
|
||||
// Construct an importer.
|
||||
conf := importer.Config{SourceImports: true}
|
||||
// Construct a loader.
|
||||
conf := loader.Config{SourceImports: true}
|
||||
|
||||
// Parse the input file.
|
||||
file, err := conf.ParseFile("myprog.go", myprog, 0)
|
|
@ -14,8 +14,8 @@ import (
|
|||
"fmt"
|
||||
"go/token"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
var (
|
|
@ -18,8 +18,8 @@ package pointer
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// Instances of 'intrinsic' generate analysis constraints for calls to
|
|
@ -10,8 +10,8 @@ import (
|
|||
"strings"
|
||||
|
||||
"code.google.com/p/go.tools/call"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// A Label is an entity that may be pointed to by a pointer, map,
|
|
@ -22,11 +22,11 @@ import (
|
|||
"testing"
|
||||
|
||||
"code.google.com/p/go.tools/call"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/pointer"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/go/types/typemap"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/pointer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
var inputs = []string{
|
||||
|
@ -151,7 +151,7 @@ func findProbe(prog *ssa.Program, probes map[*ssa.CallCommon]pointer.Pointer, e
|
|||
}
|
||||
|
||||
func doOneInput(input, filename string) bool {
|
||||
conf := importer.Config{SourceImports: true}
|
||||
conf := loader.Config{SourceImports: true}
|
||||
|
||||
// Parsing.
|
||||
f, err := conf.ParseFile(filename, input, 0)
|
|
@ -28,8 +28,8 @@ import (
|
|||
"reflect"
|
||||
|
||||
"code.google.com/p/go.tools/go/exact"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// -------------------- (reflect.Value) --------------------
|
|
@ -10,9 +10,9 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
func isEmpty(f *ssa.Function) bool { return f.Blocks == nil }
|
||||
|
@ -41,7 +41,7 @@ func main() {
|
|||
`
|
||||
|
||||
// Create a single-file main package.
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
f, err := conf.ParseFile("<input>", test, 0)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
|
@ -206,7 +206,7 @@ func TestTypesWithMethodSets(t *testing.T) {
|
|||
}
|
||||
for i, test := range tests {
|
||||
// Create a single-file main package.
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
f, err := conf.ParseFile("<input>", test.input, 0)
|
||||
if err != nil {
|
||||
t.Errorf("test %d: %s", i, err)
|
|
@ -12,8 +12,8 @@ import (
|
|||
"go/token"
|
||||
"os"
|
||||
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
)
|
||||
|
||||
// BuilderMode is a bitmask of options for diagnostics and checking.
|
||||
|
@ -37,7 +37,7 @@ const (
|
|||
//
|
||||
// mode controls diagnostics and checking during SSA construction.
|
||||
//
|
||||
func Create(iprog *importer.Program, mode BuilderMode) *Program {
|
||||
func Create(iprog *loader.Program, mode BuilderMode) *Program {
|
||||
prog := &Program{
|
||||
Fset: iprog.Fset,
|
||||
imported: make(map[string]*Package),
|
||||
|
@ -170,7 +170,7 @@ func membersFromDecl(pkg *Package, decl ast.Decl) {
|
|||
// The real work of building SSA form for each function is not done
|
||||
// until a subsequent call to Package.Build().
|
||||
//
|
||||
func (prog *Program) CreatePackage(info *importer.PackageInfo) *Package {
|
||||
func (prog *Program) CreatePackage(info *loader.PackageInfo) *Package {
|
||||
if p := prog.packages[info.Pkg]; p != nil {
|
||||
return p // already loaded
|
||||
}
|
|
@ -23,8 +23,8 @@
|
|||
// primitives in the future to facilitate constant-time dispatch of
|
||||
// switch statements, for example.
|
||||
//
|
||||
// To construct an SSA-form program, call ssa.Create on an
|
||||
// importer.Program, a set of type-checked packages created from
|
||||
// To construct an SSA-form program, call ssa.Create on a
|
||||
// loader.Program, a set of type-checked packages created from
|
||||
// parsed Go source files. The resulting ssa.Program contains all the
|
||||
// packages and their members, but SSA code is not created for
|
||||
// function bodies until a subsequent call to (*Package).Build.
|
|
@ -8,8 +8,8 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
)
|
||||
|
||||
// This program demonstrates how to run the SSA builder on a "Hello,
|
||||
|
@ -40,7 +40,7 @@ func main() {
|
|||
fmt.Println(message)
|
||||
}
|
||||
`
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
|
||||
// Parse the input file.
|
||||
file, err := conf.ParseFile("hello.go", hello, 0)
|
|
@ -14,7 +14,7 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
)
|
||||
|
||||
type externalFn func(fn *ssa.Function, args []value) value
|
|
@ -9,7 +9,7 @@ package interp
|
|||
import (
|
||||
"syscall"
|
||||
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
)
|
||||
|
||||
func fillStat(st *syscall.Stat_t, stat structure) {
|
|
@ -51,8 +51,8 @@ import (
|
|||
"reflect"
|
||||
"runtime"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
type continuation int
|
|
@ -16,10 +16,10 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/ssa/interp"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/ssa/interp"
|
||||
)
|
||||
|
||||
// Each line contains a space-separated list of $GOROOT/test/
|
||||
|
@ -168,7 +168,7 @@ func run(t *testing.T, dir, input string, success successPredicate) bool {
|
|||
inputs = append(inputs, dir+i)
|
||||
}
|
||||
|
||||
conf := importer.Config{SourceImports: true}
|
||||
conf := loader.Config{SourceImports: true}
|
||||
// TODO(adonovan): add the following packages' tests, which pass:
|
||||
// "flag", "unicode", "unicode/utf8", "testing", "log", "path".
|
||||
if err := conf.CreateFromFilenames(inputs...); err != nil {
|
||||
|
@ -318,7 +318,7 @@ func TestTestmainPackage(t *testing.T) {
|
|||
|
||||
// CreateTestMainPackage should return nil if there were no tests.
|
||||
func TestNullTestmainPackage(t *testing.T) {
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
if err := conf.CreateFromFilenames("testdata/b_test.go"); err != nil {
|
||||
t.Fatalf("ParseFile failed: %s", err)
|
||||
}
|
|
@ -13,8 +13,8 @@ import (
|
|||
"unsafe"
|
||||
|
||||
"code.google.com/p/go.tools/go/exact"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// If the target program panics, the interpreter panics with this type.
|
|
@ -16,8 +16,8 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
type opaqueType struct {
|
|
@ -42,9 +42,9 @@ import (
|
|||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/go/types/typemap"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
type value interface{}
|
|
@ -140,7 +140,7 @@ func findNamedFunc(pkg *Package, pos token.Pos) *Function {
|
|||
// - f was not built with debug information; or
|
||||
// - e is a constant expression. (For efficiency, no debug
|
||||
// information is stored for constants. Use
|
||||
// importer.PackageInfo.ValueOf(e) instead.)
|
||||
// loader.PackageInfo.ValueOf(e) instead.)
|
||||
// - e is a reference to nil or a built-in function.
|
||||
// - the value was optimised away.
|
||||
//
|
|
@ -18,13 +18,13 @@ import (
|
|||
|
||||
"code.google.com/p/go.tools/astutil"
|
||||
"code.google.com/p/go.tools/go/exact"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
func TestObjValueLookup(t *testing.T) {
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
f, err := conf.ParseFile("testdata/objlookup.go", nil, parser.ParseComments)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
|
@ -188,7 +188,7 @@ func checkVarValue(t *testing.T, prog *ssa.Program, pkg *ssa.Package, ref []ast.
|
|||
// Ensure that, in debug mode, we can determine the ssa.Value
|
||||
// corresponding to every ast.Expr.
|
||||
func TestValueForExpr(t *testing.T) {
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
f, err := conf.ParseFile("testdata/valueforexpr.go", nil, parser.ParseComments)
|
||||
if err != nil {
|
||||
t.Error(err)
|
|
@ -14,9 +14,9 @@ import (
|
|||
"sync"
|
||||
|
||||
"code.google.com/p/go.tools/go/exact"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/go/types/typemap"
|
||||
"code.google.com/p/go.tools/importer"
|
||||
)
|
||||
|
||||
// A Program is a partial or complete Go program converted to SSA form.
|
||||
|
@ -49,10 +49,10 @@ type Package struct {
|
|||
|
||||
// The following fields are set transiently, then cleared
|
||||
// after building.
|
||||
started int32 // atomically tested and set at start of build phase
|
||||
ninit int32 // number of init functions
|
||||
info *importer.PackageInfo // package ASTs and type information
|
||||
needRTTI typemap.M // types for which runtime type info is needed
|
||||
started int32 // atomically tested and set at start of build phase
|
||||
ninit int32 // number of init functions
|
||||
info *loader.PackageInfo // package ASTs and type information
|
||||
needRTTI typemap.M // types for which runtime type info is needed
|
||||
}
|
||||
|
||||
// A Member is a member of a Go package, implemented by *NamedConst,
|
|
@ -23,8 +23,8 @@ import (
|
|||
"fmt"
|
||||
"go/token"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// A ConstCase represents a single constant comparison.
|
|
@ -9,13 +9,13 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/ssa/ssautil"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/ssa/ssautil"
|
||||
)
|
||||
|
||||
func TestSwitches(t *testing.T) {
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
f, err := conf.ParseFile("testdata/switches.go", nil, parser.ParseComments)
|
||||
if err != nil {
|
||||
t.Error(err)
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
package ssautil
|
||||
|
||||
import "code.google.com/p/go.tools/ssa"
|
||||
import "code.google.com/p/go.tools/go/ssa"
|
||||
|
||||
// This file defines utilities for visiting the SSA representation of
|
||||
// a Program.
|
|
@ -18,9 +18,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"code.google.com/p/go.tools/importer"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
"code.google.com/p/go.tools/ssa/ssautil"
|
||||
"code.google.com/p/go.tools/go/loader"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/ssa/ssautil"
|
||||
)
|
||||
|
||||
func allPackages() []string {
|
||||
|
@ -52,7 +52,7 @@ func TestStdlib(t *testing.T) {
|
|||
// Load, parse and type-check the program.
|
||||
t0 := time.Now()
|
||||
|
||||
var conf importer.Config
|
||||
var conf loader.Config
|
||||
if _, err := conf.FromArgs(allPackages()); err != nil {
|
||||
t.Errorf("FromArgs failed: %s", err)
|
||||
return
|
|
@ -10,9 +10,9 @@ import (
|
|||
"go/token"
|
||||
"sort"
|
||||
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/go/types"
|
||||
"code.google.com/p/go.tools/oracle/serial"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// Callees reports the possible callees of the function call site
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
"go/token"
|
||||
|
||||
"code.google.com/p/go.tools/call"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/oracle/serial"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// Callers reports the possible callers of the function
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
"sort"
|
||||
|
||||
"code.google.com/p/go.tools/call"
|
||||
"code.google.com/p/go.tools/go/ssa"
|
||||
"code.google.com/p/go.tools/oracle/serial"
|
||||
"code.google.com/p/go.tools/ssa"
|
||||
)
|
||||
|
||||
// callgraph displays the entire callgraph of the current program.
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче