diff --git a/go/loader/util.go b/go/loader/util.go index df19b7d8..a7057171 100644 --- a/go/loader/util.go +++ b/go/loader/util.go @@ -71,29 +71,9 @@ func parseFiles(fset *token.FileSet, ctxt *build.Context, displayPath func(strin // ---------- 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) func tokenFileContainsPos(f *token.File, pos token.Pos) bool { p := int(pos) base := f.Base() return base <= p && p < base+f.Size() } - -func filename(file *ast.File, fset *token.FileSet) string { - return fset.File(file.Pos()).Name() -} diff --git a/go/pointer/pointer_test.go b/go/pointer/pointer_test.go index ea832207..4f276e70 100644 --- a/go/pointer/pointer_test.go +++ b/go/pointer/pointer_test.go @@ -423,17 +423,6 @@ func checkPointsToExpectation(e *expectation, pts pointer.PointsToSet, lineMappi 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 { var expected typeutil.Map var surplus typeutil.Map