tools: switch to standard go/types at tip
A few files have been forked and tagged "go1.5,!go1.6" to work around
minor API changes between the two types packages:
- constant.Value.String() in oracle/describe.go and its tests;
- constant.ToInt must now be called before constant.Int64Val.
- types.Config{Importer: importer.Default()} in a number of places
- go/types/typeutil/import_test.go uses lowercase names to avoid 'import "C"'.
Files in go/types/typesutil, missing from my previous CL, have been
tagged !go1.5; these files will be deleted in February.
All affected packages were tested using 1.4.1, 1.5, and ~1.6 (tip).
Change-Id: Iec7fd370e1434508149b378438fb37f65b8d2ba8
Reviewed-on: https://go-review.googlesource.com/18207
Reviewed-by: Robert Griesemer <gri@golang.org>
diff --git a/go/pointer/analysis.go b/go/pointer/analysis.go
index 4a7439e..9f3476c 100644
--- a/go/pointer/analysis.go
+++ b/go/pointer/analysis.go
@@ -11,6 +11,7 @@
import (
"fmt"
"go/token"
+ "go/types"
"io"
"os"
"reflect"
@@ -20,7 +21,6 @@
"golang.org/x/tools/go/callgraph"
"golang.org/x/tools/go/ssa"
- "golang.org/x/tools/go/types"
"golang.org/x/tools/go/types/typeutil"
)
diff --git a/go/pointer/constraint.go b/go/pointer/constraint.go
index 5b9265a..ea44287 100644
--- a/go/pointer/constraint.go
+++ b/go/pointer/constraint.go
@@ -6,9 +6,7 @@
package pointer
-import (
- "golang.org/x/tools/go/types"
-)
+import "go/types"
type constraint interface {
// For a complex constraint, returns the nodeid of the pointer
diff --git a/go/pointer/gen.go b/go/pointer/gen.go
index 9d550a7..405a63b 100644
--- a/go/pointer/gen.go
+++ b/go/pointer/gen.go
@@ -15,10 +15,10 @@
import (
"fmt"
"go/token"
+ "go/types"
"golang.org/x/tools/go/callgraph"
"golang.org/x/tools/go/ssa"
- "golang.org/x/tools/go/types"
)
var (
diff --git a/go/pointer/hvn.go b/go/pointer/hvn.go
index c144559..e550bc9 100644
--- a/go/pointer/hvn.go
+++ b/go/pointer/hvn.go
@@ -165,11 +165,11 @@
import (
"fmt"
+ "go/types"
"io"
"reflect"
"golang.org/x/tools/container/intsets"
- "golang.org/x/tools/go/types"
)
// A peLabel is a pointer-equivalence label: two nodes with the same
diff --git a/go/pointer/intrinsics.go b/go/pointer/intrinsics.go
index 69da377..fbfb36d 100644
--- a/go/pointer/intrinsics.go
+++ b/go/pointer/intrinsics.go
@@ -19,9 +19,9 @@
import (
"fmt"
+ "go/types"
"golang.org/x/tools/go/ssa"
- "golang.org/x/tools/go/types"
)
// Instances of 'intrinsic' generate analysis constraints for calls to
diff --git a/go/pointer/labels.go b/go/pointer/labels.go
index 4709272..bfe60d2 100644
--- a/go/pointer/labels.go
+++ b/go/pointer/labels.go
@@ -9,10 +9,10 @@
import (
"fmt"
"go/token"
+ "go/types"
"strings"
"golang.org/x/tools/go/ssa"
- "golang.org/x/tools/go/types"
)
// A Label is an entity that may be pointed to by a pointer, map,
diff --git a/go/pointer/pointer_test.go b/go/pointer/pointer_test.go
index ddfacf7..52af485 100644
--- a/go/pointer/pointer_test.go
+++ b/go/pointer/pointer_test.go
@@ -19,6 +19,7 @@
"errors"
"fmt"
"go/token"
+ "go/types"
"io/ioutil"
"os"
"regexp"
@@ -31,7 +32,6 @@
"golang.org/x/tools/go/pointer"
"golang.org/x/tools/go/ssa"
"golang.org/x/tools/go/ssa/ssautil"
- "golang.org/x/tools/go/types"
"golang.org/x/tools/go/types/typeutil"
)
diff --git a/go/pointer/reflect.go b/go/pointer/reflect.go
index a0bfda6..bdb22cf 100644
--- a/go/pointer/reflect.go
+++ b/go/pointer/reflect.go
@@ -32,11 +32,11 @@
import (
"fmt"
+ exact "go/constant"
+ "go/types"
"reflect"
- "golang.org/x/tools/go/exact"
"golang.org/x/tools/go/ssa"
- "golang.org/x/tools/go/types"
)
func init() {
diff --git a/go/pointer/solve.go b/go/pointer/solve.go
index 8cff32f..3c60685 100644
--- a/go/pointer/solve.go
+++ b/go/pointer/solve.go
@@ -11,8 +11,7 @@
import (
"fmt"
-
- "golang.org/x/tools/go/types"
+ "go/types"
)
type solverState struct {
diff --git a/go/pointer/util.go b/go/pointer/util.go
index 7a43187..4d2fa74 100644
--- a/go/pointer/util.go
+++ b/go/pointer/util.go
@@ -9,6 +9,7 @@
import (
"bytes"
"fmt"
+ "go/types"
"log"
"os"
"os/exec"
@@ -16,7 +17,6 @@
"time"
"golang.org/x/tools/container/intsets"
- "golang.org/x/tools/go/types"
)
// CanPoint reports whether the type T is pointerlike,