Go patch committed: emit type specific functions for aliases

Ian Lance Taylor iant@golang.org
Thu Sep 14 03:51:00 GMT 2017


When the Go frontend has an alias for a struct or array that requires
a type-specific function, don't emit the function with the alias name.
Emit it with the struct/array as usual.

The test case is for this is https://golang.org/cl/62531.

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

Ian
-------------- next part --------------
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 252746)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-b0a46c2cdb915ddc4a4e401af9ef6eb2bcd4d4ea
+89e46ae0cde7bebd8e97434355c5b7e57d902613
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/gogo.cc
===================================================================
--- gcc/go/gofrontend/gogo.cc	(revision 251948)
+++ gcc/go/gofrontend/gogo.cc	(working copy)
@@ -2498,6 +2498,8 @@ Specific_type_functions::type(Type* t)
     case Type::TYPE_NAMED:
       {
 	Named_type* nt = t->named_type();
+	if (nt->is_alias())
+	  return TRAVERSE_CONTINUE;
 	if (t->needs_specific_type_functions(this->gogo_))
 	  t->type_functions(this->gogo_, nt, NULL, NULL, &hash_fn, &equal_fn);
 


More information about the Gcc-patches mailing list