Go patch committed: Use build_variant_type_copy, not build_distinct_type_copy

Ian Lance Taylor iant@golang.org
Thu Jun 28 17:46:00 GMT 2018


This patch to the Go frontend changes set_placeholder_struct_type to
use build_variant_type_copy rather than build_distinct_type_copy.
This is for PR 86343, which noted that the DECL_CONTEXT of the fields
in the copy were pointing to the wrong type.  Using
build_variant_type_copy puts the types in right relationship for the
DECL_CONTEXT setting.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian

2018-06-28  Ian Lance Taylor  <iant@golang.org>

PR go/86343
* go-gcc.cc (Gcc_backend::set_placeholder_struct_type): Call
build_variant_type_copy rather than build_distinct_type_copy.
-------------- next part --------------
Index: go-gcc.cc
===================================================================
--- go-gcc.cc	(revision 262150)
+++ go-gcc.cc	(working copy)
@@ -1100,7 +1100,7 @@ Gcc_backend::set_placeholder_struct_type
   if (TYPE_NAME(t) != NULL_TREE)
     {
       // Build the data structure gcc wants to see for a typedef.
-      tree copy = build_distinct_type_copy(t);
+      tree copy = build_variant_type_copy(t);
       TYPE_NAME(copy) = NULL_TREE;
       DECL_ORIGINAL_TYPE(TYPE_NAME(t)) = copy;
     }


More information about the Gcc-patches mailing list