Descriptiongo/types: New Go type hierarchy implementation for AST.
This CL defines a new, more Go-like representation of
Go types (different structs for different types as
opposed to a single Type node). It also implements
an ast.Importer for object/archive files generated
by the gc compiler tool chain. Besides the individual
type structs, the main difference is the handling of
named types: In the old world, a named type had a
non-nil *Object pointer but otherwise looked no
different from other types. In this new model, named
types have their own representation types.Name. As
a result, resolving cycles is a bit simpler during
construction, at the cost of having to deal with
types.Name nodes explicitly later. It remains to be
seen if this is a good approach. Nevertheless, code
involving types reads more nicely and benefits from
full type checking. Also, the representation seems
to more closely match the spec wording.
Credits: The original version of the gc importer was
written by Evan Shaw (chickencha@gmail.com). The new
version in this CL is based largely on Evan's original
code but contains bug fixes, a few simplifications,
some restructuring, and was adjusted to use the
new type hierarchy. I have added a comprehensive test
that imports all packages found under $GOROOT/pkg (with
a 3s time-out to limit the run-time of the test). Run
gotest -v for details.
The original version of ExportData (exportdata.go) was
written by Russ Cox (rsc@golang.org). The current version
is returning the internal buffer positioned at the beginning
of the export data instead of printing the export data to
stdout.
With the new types package, the existing in-progress
typechecker package is deprecated. I will delete it
once all functionality has been brought over.
Patch Set 1 #Patch Set 2 : diff -r cf1342f0c8bd https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 9bb646cecf58 https://go.googlecode.com/hg/ #Patch Set 4 : diff -r a15522fba283 https://go.googlecode.com/hg/ #Patch Set 5 : diff -r a15522fba283 https://go.googlecode.com/hg/ #Patch Set 6 : diff -r f782663275a7 https://go.googlecode.com/hg/ #Patch Set 7 : diff -r 9f27edac5018 https://go.googlecode.com/hg/ #Patch Set 8 : diff -r 7df08a2207e6 https://go.googlecode.com/hg/ #Patch Set 9 : diff -r 1abd0a633574 https://go.googlecode.com/hg/ #Patch Set 10 : diff -r b002b8e25d25 https://go.googlecode.com/hg/ #Patch Set 11 : diff -r b002b8e25d25 https://go.googlecode.com/hg/ #Patch Set 12 : diff -r b002b8e25d25 https://go.googlecode.com/hg/ #Patch Set 13 : diff -r b002b8e25d25 https://go.googlecode.com/hg/ #Patch Set 14 : diff -r b002b8e25d25 https://go.googlecode.com/hg/ #
Total comments: 18
Patch Set 15 : diff -r fd6ade18359d https://go.googlecode.com/hg/ #
Total comments: 63
Patch Set 16 : diff -r 56f8b1cc5129 https://go.googlecode.com/hg/ #Patch Set 17 : diff -r 56f8b1cc5129 https://go.googlecode.com/hg/ #Patch Set 18 : diff -r ebef2da9ab43 https://go.googlecode.com/hg/ #Patch Set 19 : diff -r ebef2da9ab43 https://go.googlecode.com/hg/ #Patch Set 20 : diff -r ebef2da9ab43 https://go.googlecode.com/hg/ #
Total comments: 4
Patch Set 21 : diff -r ebef2da9ab43 https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 22 : diff -r ebef2da9ab43 https://go.googlecode.com/hg/ #
MessagesTotal messages: 21
|