go.tools: remove dead code
LGTM=gri R=gri CC=golang-codereviews https://golang.org/cl/90320043
This commit is contained in:
parent
8e263c554d
commit
6e03bb4eb4
|
@ -71,29 +71,9 @@ func parseFiles(fset *token.FileSet, ctxt *build.Context, displayPath func(strin
|
||||||
|
|
||||||
// ---------- Internal helpers ----------
|
// ---------- Internal helpers ----------
|
||||||
|
|
||||||
// unparen returns e with any enclosing parentheses stripped.
|
|
||||||
func unparen(e ast.Expr) ast.Expr {
|
|
||||||
for {
|
|
||||||
p, ok := e.(*ast.ParenExpr)
|
|
||||||
if !ok {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
e = p.X
|
|
||||||
}
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
func unreachable() {
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(adonovan): make this a method: func (*token.File) Contains(token.Pos)
|
// TODO(adonovan): make this a method: func (*token.File) Contains(token.Pos)
|
||||||
func tokenFileContainsPos(f *token.File, pos token.Pos) bool {
|
func tokenFileContainsPos(f *token.File, pos token.Pos) bool {
|
||||||
p := int(pos)
|
p := int(pos)
|
||||||
base := f.Base()
|
base := f.Base()
|
||||||
return base <= p && p < base+f.Size()
|
return base <= p && p < base+f.Size()
|
||||||
}
|
}
|
||||||
|
|
||||||
func filename(file *ast.File, fset *token.FileSet) string {
|
|
||||||
return fset.File(file.Pos()).Name()
|
|
||||||
}
|
|
||||||
|
|
|
@ -423,17 +423,6 @@ func checkPointsToExpectation(e *expectation, pts pointer.PointsToSet, lineMappi
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
// underlying returns the underlying type of typ. Copied from go/types.
|
|
||||||
func underlyingType(typ types.Type) types.Type {
|
|
||||||
if typ, ok := typ.(*types.Named); ok {
|
|
||||||
return typ.Underlying() // underlying types are never NamedTypes
|
|
||||||
}
|
|
||||||
if typ == nil {
|
|
||||||
panic("underlying(nil)")
|
|
||||||
}
|
|
||||||
return typ
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkTypesExpectation(e *expectation, pts pointer.PointsToSet, typ types.Type) bool {
|
func checkTypesExpectation(e *expectation, pts pointer.PointsToSet, typ types.Type) bool {
|
||||||
var expected typeutil.Map
|
var expected typeutil.Map
|
||||||
var surplus typeutil.Map
|
var surplus typeutil.Map
|
||||||
|
|
Loading…
Reference in New Issue