go.tools/go/callgraph: simplifications to API.

1) We remove context sensitivity from API.  The pointer analysis is
   not sufficiently context-sensitive for the context information to
   be worth exposing.  (The actual analysis precision still benefits
   from being context-sensitive, though.)  Since all clients would
   discard the context info, we now do that for them.
2) Make the graph doubly-linked.  Edges are now shared by the Nodes
   at both ends of the edge so it's possible to navigate more easily
   (e.g. to the callers).
3) Graph and Node are now concrete, not interfaces.

Less code in every file!

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/66460043
diff --git a/go/pointer/gen.go b/go/pointer/gen.go
index 1a2bfcf..77cf159 100644
--- a/go/pointer/gen.go
+++ b/go/pointer/gen.go
@@ -14,6 +14,7 @@
 	"fmt"
 	"go/token"
 
+	"code.google.com/p/go.tools/go/callgraph"
 	"code.google.com/p/go.tools/go/ssa"
 	"code.google.com/p/go.tools/go/types"
 )
@@ -620,7 +621,7 @@
 	} else {
 		obj = a.objectNode(nil, fn) // shared contour
 	}
-	a.callEdge(site, obj)
+	a.callEdge(caller, site, obj)
 
 	sig := call.Signature()
 
@@ -726,7 +727,7 @@
 	fn := a.prog.LookupMethod(a.reflectRtypePtr, call.Method.Pkg(), call.Method.Name())
 
 	obj := a.makeFunctionObject(fn, site) // new contour for this call
-	a.callEdge(site, obj)
+	a.callEdge(caller, site, obj)
 
 	// From now on, it's essentially a static call, but little is
 	// gained by factoring together the code for both cases.
@@ -1213,9 +1214,7 @@
 }
 
 // generate generates offline constraints for the entire program.
-// It returns the synthetic root of the callgraph.
-//
-func (a *analysis) generate() *cgnode {
+func (a *analysis) generate() {
 	// Create a dummy node since we use the nodeid 0 for
 	// non-pointerlike variables.
 	a.addNodes(tInvalid, "(zero)")
@@ -1232,6 +1231,10 @@
 
 	root := a.genRootCalls()
 
+	if a.config.BuildCallGraph {
+		a.result.CallGraph = callgraph.New(root.fn)
+	}
+
 	// Create nodes and constraints for all methods of all types
 	// that are dynamically accessible via reflection or interfaces.
 	for _, T := range a.prog.TypesWithMethodSets() {
@@ -1253,6 +1256,4 @@
 		a.endObject(obj, nil, "<command-line args>")
 		a.addressOf(T, a.objectNode(nil, os.Var("Args")), obj)
 	}
-
-	return root
 }