aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/gogo.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-08-30 21:49:49 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-08-30 21:49:49 +0000
commit4a140826453da37a134d792e0224f4e37343e68a (patch)
tree04d27dc317f007c64a3954cd2744b89bc7ed0b47 /gcc/go/gofrontend/gogo.cc
parentaff0632d4fa0d55b2c830e5dc975242dd246fc87 (diff)
downloadgcc-4a140826453da37a134d792e0224f4e37343e68a.zip
gcc-4a140826453da37a134d792e0224f4e37343e68a.tar.gz
gcc-4a140826453da37a134d792e0224f4e37343e68a.tar.bz2
compile, runtime: permit anonymous and empty fields in C header
Permit putting structs with anonymous and empty fields in the C header file runtime.inc that is used to build the C runtime code. This is required for upcoming 1.13 support, as the m struct has picked up an anonymous field. Doing this lets the C header contain all the type descriptor structs, so start using those in the C code. This cuts the number of copies of type descriptor definitions from 3 to 2. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192343 From-SVN: r275227
Diffstat (limited to 'gcc/go/gofrontend/gogo.cc')
-rw-r--r--gcc/go/gofrontend/gogo.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index 7aec0cf..f8114ece 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -5238,11 +5238,11 @@ Gogo::write_c_header()
// package they are mostly types defined by mkrsysinfo.sh based
// on the C system header files. We don't need to translate
// types to C and back to Go. But do accept the special cases
- // _defer and _panic.
+ // _defer, _panic, and _type.
std::string name = Gogo::unpack_hidden_name(no->name());
if (name[0] == '_'
&& (name[1] < 'A' || name[1] > 'Z')
- && (name != "_defer" && name != "_panic"))
+ && (name != "_defer" && name != "_panic" && name != "_type"))
continue;
if (no->is_type() && no->type_value()->struct_type() != NULL)