diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-30 21:49:49 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-30 21:49:49 +0000 |
commit | 4a140826453da37a134d792e0224f4e37343e68a (patch) | |
tree | 04d27dc317f007c64a3954cd2744b89bc7ed0b47 /libgo/runtime/go-construct-map.c | |
parent | aff0632d4fa0d55b2c830e5dc975242dd246fc87 (diff) | |
download | gcc-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 'libgo/runtime/go-construct-map.c')
-rw-r--r-- | libgo/runtime/go-construct-map.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libgo/runtime/go-construct-map.c b/libgo/runtime/go-construct-map.c index 0e71ba93..a721058 100644 --- a/libgo/runtime/go-construct-map.c +++ b/libgo/runtime/go-construct-map.c @@ -9,20 +9,17 @@ #include <stdlib.h> #include "runtime.h" -#include "go-type.h" -extern void *makemap (const struct __go_map_type *, intgo hint, - void *) +extern void *makemap (const struct maptype *, intgo hint, void *) __asm__ (GOSYM_PREFIX "runtime.makemap"); -extern void *mapassign (const struct __go_map_type *, void *hmap, - const void *key) +extern void *mapassign (const struct maptype *, void *hmap, const void *key) __asm__ (GOSYM_PREFIX "runtime.mapassign"); void * -__go_construct_map (const struct __go_map_type *type, - uintptr_t count, uintptr_t entry_size, - uintptr_t val_offset, const void *ventries) +__go_construct_map (const struct maptype *type, uintptr_t count, + uintptr_t entry_size, uintptr_t val_offset, + const void *ventries) { void *ret; const unsigned char *entries; @@ -35,7 +32,7 @@ __go_construct_map (const struct __go_map_type *type, for (i = 0; i < count; ++i) { p = mapassign (type, ret, entries); - typedmemmove (type->__val_type, p, entries + val_offset); + typedmemmove (type->elem, p, entries + val_offset); entries += entry_size; } |