go.types/ssa: split the load/parse/typecheck logic off into a separate package.

PLEASE NOTE: the APIs for both "importer" and "ssa" packages
will continue to evolve and both need some polishing; the key
thing is that this CL splits them.

The go.types/importer package contains contains the Importer,
which takes care of the mechanics of loading a set of packages
and type-checking them.  It exposes for each package a
PackageInfo containing:
- the package's ASTs (i.e. the input to the typechecker)
- the types.Package object
- the memoization of the typechecker callbacks for identifier
  resolution, constant folding and expression type inference.

Method-set computation (and hence bridge-method creation) is
now moved to after creation of all packages: since they are no
longer created in topological order, we can't guarantee the
needed delegate methods exist yet.

ssa.Package no longer has public TypeOf, ObjectOf, ValueOf methods.
The private counterparts are valid only during the build phase.

Also:
- added to go/types an informative error (not crash) for an
  importer() returning nil without error.
- removed Package.Name(), barely needed.
- changed Package.String() slightly.
- flag what looks like a bug in makeBridgeMethod. Will follow up.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9898043
diff --git a/ssa/ssa.go b/ssa/ssa.go
index a15337e..79f1bf8 100644
--- a/ssa/ssa.go
+++ b/ssa/ssa.go
@@ -11,6 +11,7 @@
 
 	"code.google.com/p/go.tools/go/exact"
 	"code.google.com/p/go.tools/go/types"
+	"code.google.com/p/go.tools/importer"
 )
 
 // A Program is a partial or complete Go program converted to SSA form.
@@ -18,7 +19,7 @@
 // lifetime.
 //
 type Program struct {
-	Files    *token.FileSet            // position information for the files of this Program
+	Files    *token.FileSet            // position information for the files of this Program [TODO: rename Fset]
 	Packages map[string]*Package       // all loaded Packages, keyed by import path
 	Builtins map[types.Object]*Builtin // all built-in functions, keyed by typechecker objects.
 
@@ -35,18 +36,14 @@
 //
 type Package struct {
 	Prog    *Program          // the owning program
-	Types   *types.Package    // the type checker's package object for this package.
+	Types   *types.Package    // the type checker's package object for this package
 	Members map[string]Member // all exported and unexported members of the package
 	Init    *Function         // the package's (concatenated) init function
 
-	// These fields are available between package creation and SSA
-	// building, but are then cleared unless Context.RetainAST(pkg).
-	Files     []*ast.File // abstract syntax for the package's files
-	*TypeInfo             // type-checker intermediate results
-
 	// The following fields are set transiently during building,
 	// then cleared.
 	started  int32                   // atomically tested and set at start of build phase
+	info     *importer.PackageInfo   // package ASTs and type information
 	nTo1Vars map[*ast.ValueSpec]bool // set of n:1 ValueSpecs already built
 }
 
@@ -1286,8 +1283,6 @@
 func (t *Type) String() string   { return t.Name() }
 func (t *Type) Type() types.Type { return t.NamedType }
 
-func (p *Package) Name() string { return p.Types.Name() }
-
 func (c *Constant) Name() string     { return c.name }
 func (c *Constant) Pos() token.Pos   { return c.pos }
 func (c *Constant) String() string   { return c.Name() }