Commit Graph

5 Commits

Author SHA1 Message Date
Peter Collingbourne 4329a10ae7 go.tools/go: separate interface construction from method set construction
We introduce a method (*Interface).Complete(), which is intended
to be called from clients after all embedded interfaces have been
fully defined. For importers, this will definitely be the case
after the import has finished, so each importer have been updated
to do so, with the exception of the gcimporter, which does not use
embedded interfaces, therefore Complete() can be called immediately
after construction.

Building the method set separately from the constructor type caused
some problems with go/importer, which copies the types.Interface
object, leading to there existing two almost-identical interface
types referenced from interface method receivers, only one of which
has been completed. To avoid this situation, the importer has been
modified to construct the interface object only once.

Fixes golang/go#8177.

LGTM=gri
R=gri, dave, gordon.klaus, adonovan
CC=golang-codereviews
https://golang.org/cl/105060044
2014-07-09 20:00:49 -07:00
Peter Collingbourne 02990bd494 go.tools/go/gccgoimporter: keep track of package and import priority
Clients such as compilers need this information in order
to correctly link against imported packages.

This also adds support for the condensed import data format
where the priority information is stored as a suffix of the
condensed import data, as well as support for archive files.

LGTM=gri
R=gri
CC=golang-codereviews, iant
https://golang.org/cl/78740043
2014-06-17 10:56:47 -07:00
Alan Donovan 49eaa56ed1 go.tools/go/*: fix breakage caused by removal of types.NewPackage parameter.
(This fixes the build, but one test is failing.)

TBR=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/66730043
2014-02-20 20:11:00 -05:00
Robert Griesemer 184bc0cc8c go.tools/go/gccgoimporter: remove dead code
R=adonovan
CC=golang-codereviews
https://golang.org/cl/53340043
2014-01-16 13:19:39 -08:00
Peter Collingbourne 893253274d go.tools/go/gccgoimporter: importer for gccgo export data
This can import all of the standard library, and has been tested
by using gotype to type check libgo with gccgo's export data (this
would be nice to automate, but I can't see a good way to do it,
not least because system-specific source files cause errors which
I needed to identify manually).

It includes a builtin export locator. Unfortunately I can't see a
more reliable way to locate the builtin export files than to parse
the output of 'gccgo -###'.

R=gri, iant, gri
CC=golang-codereviews, golang-dev
https://golang.org/cl/31860043
2014-01-08 09:00:50 -08:00