From: ian Date: Mon, 1 Oct 2018 22:25:52 +0000 (+0000) Subject: compiler: use the underlying type to build placeholder type for alias X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68005003c6a1c48576087e490d200df04a6b18d3;p=thirdparty%2Fgcc.git compiler: use the underlying type to build placeholder type for alias When asking for a placeholder type of an alias type, build 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. Reviewed-on: https://go-review.googlesource.com/138635 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264773 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 6ad214689fb7..ad3253f4b85b 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index ad0704cc2da0..3768719a03ac 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -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: