diff mbox series

Go patch committed: Use underlying type to build placeholder type for aliases

Message ID CAOyqgcUDhro4fUkFRRtOhmHcu5VG_p9uJp0pxtkfXRnrJo4tWw@mail.gmail.com
State New
Headers show
Series Go patch committed: Use underlying type to build placeholder type for aliases | expand

Commit Message

Ian Lance Taylor Oct. 1, 2018, 10:26 p.m. UTC
This patch to the Go frontend by Cherry Zhang uses the underlying type
to build the placeholder type for aliases.  When asking for a
placeholder type of an alias type, this builds a placeholder for the
underlying type, instead of treating the alias as a named type and
calling get_backend.  The latter may fail as we may not be ready to
build a complete backend type.  We have already used a unified backend
type for alias type and its underlying type.  Do the same for
placeholders as well.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
diff mbox series

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 264772)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-2f56d51c6b3104242613c74b02fa6c63a2fe16c5
+53d0d7ca278a5612fcdb5fb098e7bf950a0178ef
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/types.cc
===================================================================
--- gcc/go/gofrontend/types.cc	(revision 264648)
+++ gcc/go/gofrontend/types.cc	(working copy)
@@ -1125,6 +1125,8 @@  Type::get_backend_placeholder(Gogo* gogo
     case TYPE_FORWARD:
       // Named types keep track of their own dependencies and manage
       // their own placeholders.
+      if (this->named_type() != NULL && this->named_type()->is_alias())
+        return this->unalias()->get_backend_placeholder(gogo);
       return this->get_backend(gogo);
 
     case TYPE_INTERFACE: