This patch to the Go frontend skips writing sink constants to the C
header file.  These are constants named "_".  We were generating
nonsensical $sinkconst names in the header files, which are
unnecessary and can break building the C code in some cases.
Bootstrapped on x86_64-pc-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 257033)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-0bbc03f81c862fb35be3edee9824698a7892a17e
+016ea21c4cba324c6ea6424da7988c6f985e671b
 
 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 257033)
+++ gcc/go/gofrontend/gogo.cc   (working copy)
@@ -4633,7 +4633,9 @@ Gogo::write_c_header()
 
       if (no->is_type() && no->type_value()->struct_type() != NULL)
        types.push_back(no);
-      if (no->is_const() && no->const_value()->type()->integer_type() != NULL)
+      if (no->is_const()
+         && no->const_value()->type()->integer_type() != NULL
+         && !no->const_value()->is_sink())
        {
          Numeric_constant nc;
          unsigned long val;

Reply via email to