This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Finalize methods when importing types


This patch to the Go frontend by Than McIntosh changes the compiler to
be more aggressive about finalizing methods on imported types, to
avoid problems with interface types that are imported but remain
unreachable until a later stage in the compilation.

The normal pattern prior to this change was that the import process
would leave imported interface types alone, and rely on
Gogo::finalize_methods to locate and finalize all interface types at a
later point.  This way of doing things was not working in all cases
due to the fact that we can import an interface type that is only
reachable from the body of an inlinable function, meaning that we
can't "find" the type during the methods finalize phase.

The importer's Import::read_types() now makes a pass over all imported
types to finalize methods on any newly imported type, which takes care
of the issue.

New test case for this problem in https://golang.org/cl/185517.

This fixes https://golang.org/issue/33013.

Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]