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/runtime.h | |
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/runtime.h')
-rw-r--r-- | libgo/runtime/runtime.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index 4102f5d..8ff578e 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -72,14 +72,9 @@ typedef struct schedt Sched; typedef struct __go_open_array Slice; typedef struct iface Iface; typedef struct eface Eface; -typedef struct __go_type_descriptor Type; typedef struct _defer Defer; typedef struct _panic Panic; -typedef struct __go_ptr_type PtrType; -typedef struct __go_func_type FuncType; -typedef struct __go_map_type MapType; - typedef struct tracebackg Traceback; typedef struct location Location; @@ -96,6 +91,10 @@ struct FuncVal // variable-size, fn-specific data here }; +// Type structs will be defined by runtime.inc. +struct _type; +struct functype; + #include "array.h" // Rename Go types generated by mkrsysinfo.sh from C types, to avoid @@ -208,7 +207,6 @@ intgo runtime_findnull(const byte*) void runtime_gogo(G*) __asm__ (GOSYM_PREFIX "runtime.gogo"); -struct __go_func_type; void runtime_args(int32, byte**) __asm__ (GOSYM_PREFIX "runtime.args"); void runtime_osinit(void) @@ -249,7 +247,7 @@ void runtime_signalstack(byte*, uintptr) __asm__ (GOSYM_PREFIX "runtime.signalstack"); void runtime_mallocinit(void) __asm__ (GOSYM_PREFIX "runtime.mallocinit"); -void* runtime_mallocgc(uintptr, const Type*, bool) +void* runtime_mallocgc(uintptr, const struct _type*, bool) __asm__ (GOSYM_PREFIX "runtime.mallocgc"); void* runtime_sysAlloc(uintptr, uint64*) __asm__ (GOSYM_PREFIX "runtime.sysAlloc"); @@ -366,7 +364,7 @@ void __wrap_rtems_task_variable_add(void **); /* * runtime go-called */ -void reflect_call(const struct __go_func_type *, FuncVal *, _Bool, _Bool, +void reflect_call(const struct functype *, FuncVal *, _Bool, _Bool, void **, void **) __asm__ (GOSYM_PREFIX "runtime.reflectcall"); void runtime_panic(Eface) @@ -442,9 +440,7 @@ extern void _cgo_notify_runtime_init_done (void) __asm__ (GOSYM_PREFIX "runtime._cgo_notify_runtime_init_done"); extern _Bool runtime_iscgo; extern uintptr __go_end __attribute__ ((weak)); -extern void *getitab(const struct __go_type_descriptor *, - const struct __go_type_descriptor *, - _Bool) +extern void *getitab(const struct _type *, const struct _type *, _Bool) __asm__ (GOSYM_PREFIX "runtime.getitab"); extern void runtime_cpuinit(void); @@ -454,7 +450,7 @@ extern void setIsCgo(void) __asm__ (GOSYM_PREFIX "runtime.setIsCgo"); extern void setSupportAES(bool) __asm__ (GOSYM_PREFIX "runtime.setSupportAES"); -extern void typedmemmove(const Type *, void *, const void *) +extern void typedmemmove(const struct _type *, void *, const void *) __asm__ (GOSYM_PREFIX "runtime.typedmemmove"); extern Sched* runtime_getsched(void) __asm__ (GOSYM_PREFIX "runtime.getsched"); |