diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-05-31 21:32:47 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-05-31 21:32:47 +0000 |
commit | 2099d4465862a0a004b1617ff1c9ab5ee6bb8a67 (patch) | |
tree | ba0db317857e6121a9a5482590f0476a23ff0323 /libgo/runtime | |
parent | 6303331c3330222fef94eff8d8d35c99ca1d3e88 (diff) | |
download | gcc-2099d4465862a0a004b1617ff1c9ab5ee6bb8a67.zip gcc-2099d4465862a0a004b1617ff1c9ab5ee6bb8a67.tar.gz gcc-2099d4465862a0a004b1617ff1c9ab5ee6bb8a67.tar.bz2 |
runtime: drop unused C type reflection code
In particular, drop __go_type_descriptors_equal, which is no longer
used, and will be made obsolete by CL 179598.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179858
From-SVN: r271823
Diffstat (limited to 'libgo/runtime')
-rw-r--r-- | libgo/runtime/go-type.h | 140 | ||||
-rw-r--r-- | libgo/runtime/go-typedesc-equal.c | 28 | ||||
-rw-r--r-- | libgo/runtime/runtime.h | 2 |
3 files changed, 0 insertions, 170 deletions
diff --git a/libgo/runtime/go-type.h b/libgo/runtime/go-type.h index 03806f6..1935703 100644 --- a/libgo/runtime/go-type.h +++ b/libgo/runtime/go-type.h @@ -153,53 +153,6 @@ struct __go_uncommon_type struct __go_open_array __methods; }; -/* The type descriptor for a fixed array type. */ - -struct __go_array_type -{ - /* Starts like all type descriptors. */ - struct __go_type_descriptor __common; - - /* The element type. */ - struct __go_type_descriptor *__element_type; - - /* The type of a slice of the same element type. */ - struct __go_type_descriptor *__slice_type; - - /* The length of the array. */ - uintptr_t __len; -}; - -/* The type descriptor for a slice. */ - -struct __go_slice_type -{ - /* Starts like all other type descriptors. */ - struct __go_type_descriptor __common; - - /* The element type. */ - struct __go_type_descriptor *__element_type; -}; - -/* The direction of a channel. */ -#define CHANNEL_RECV_DIR 1 -#define CHANNEL_SEND_DIR 2 -#define CHANNEL_BOTH_DIR (CHANNEL_RECV_DIR | CHANNEL_SEND_DIR) - -/* The type descriptor for a channel. */ - -struct __go_channel_type -{ - /* Starts like all other type descriptors. */ - struct __go_type_descriptor __common; - - /* The element type. */ - const struct __go_type_descriptor *__element_type; - - /* The direction. */ - uintptr_t __dir; -}; - /* The type descriptor for a function. */ struct __go_func_type @@ -221,34 +174,6 @@ struct __go_func_type struct __go_open_array __out; }; -/* A method on an interface type. */ - -struct __go_interface_method -{ - /* The name of the method. */ - const struct String *__name; - - /* This is NULL for an exported method, or the name of the package - where it lives. */ - const struct String *__pkg_path; - - /* The real type of the method. */ - struct __go_type_descriptor *__type; -}; - -/* An interface type. */ - -struct __go_interface_type -{ - /* Starts like all other type descriptors. */ - struct __go_type_descriptor __common; - - /* Array of __go_interface_method . The methods are sorted in the - same order that they appear in the definition of the - interface. */ - struct __go_open_array __methods; -}; - /* A map type. */ struct __go_map_type @@ -301,69 +226,4 @@ struct __go_ptr_type const struct __go_type_descriptor *__element_type; }; -/* A field in a structure. */ - -struct __go_struct_field -{ - /* The name of the field--NULL for an anonymous field. */ - const struct String *__name; - - /* This is NULL for an exported method, or the name of the package - where it lives. */ - const struct String *__pkg_path; - - /* The type of the field. */ - const struct __go_type_descriptor *__type; - - /* The field tag, or NULL. */ - const struct String *__tag; - - /* The offset of the field in the struct. */ - uintptr_t __offset; -}; - -/* A struct type. */ - -struct __go_struct_type -{ - /* Starts like all other type descriptors. */ - struct __go_type_descriptor __common; - - /* An array of struct __go_struct_field. */ - struct __go_open_array __fields; -}; - -/* Whether a type descriptor is a pointer. */ - -static inline _Bool -__go_is_pointer_type (const struct __go_type_descriptor *td) -{ - return ((td->__code & GO_CODE_MASK) == GO_PTR - || (td->__code & GO_CODE_MASK) == GO_UNSAFE_POINTER); -} - -/* Call a type hash function, given the __hashfn value. */ - -static inline uintptr_t -__go_call_hashfn (const FuncVal *hashfn, const void *p, uintptr_t seed, - uintptr_t size) -{ - uintptr_t (*h) (const void *, uintptr_t, uintptr_t) = (void *) hashfn->fn; - return __builtin_call_with_static_chain (h (p, seed, size), hashfn); -} - -/* Call a type equality function, given the __equalfn value. */ - -static inline _Bool -__go_call_equalfn (const FuncVal *equalfn, const void *p1, const void *p2, - uintptr_t size) -{ - _Bool (*e) (const void *, const void *, uintptr_t) = (void *) equalfn->fn; - return __builtin_call_with_static_chain (e (p1, p2, size), equalfn); -} - -extern _Bool -__go_type_descriptors_equal(const struct __go_type_descriptor*, - const struct __go_type_descriptor*); - #endif /* !defined(LIBGO_GO_TYPE_H) */ diff --git a/libgo/runtime/go-typedesc-equal.c b/libgo/runtime/go-typedesc-equal.c deleted file mode 100644 index 90079f2..0000000 --- a/libgo/runtime/go-typedesc-equal.c +++ /dev/null @@ -1,28 +0,0 @@ -/* go-typedesc-equal.c -- return whether two type descriptors are equal. - - Copyright 2009 The Go Authors. All rights reserved. - Use of this source code is governed by a BSD-style - license that can be found in the LICENSE file. */ - -#include "runtime.h" -#include "go-string.h" -#include "go-type.h" - -/* Compare type descriptors for equality. This is necessary because - types may have different descriptors in different shared libraries. - Also, unnamed types may have multiple type descriptors even in a - single shared library. */ - -_Bool -__go_type_descriptors_equal (const struct __go_type_descriptor *td1, - const struct __go_type_descriptor *td2) -{ - if (td1 == td2) - return 1; - /* In a type switch we can get a NULL descriptor. */ - if (td1 == NULL || td2 == NULL) - return 0; - if (td1->__code != td2->__code || td1->__hash != td2->__hash) - return 0; - return __go_ptr_strings_equal (td1->__reflection, td2->__reflection); -} diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index a421dea..0aa8ff9 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -78,9 +78,7 @@ typedef struct _panic Panic; typedef struct __go_ptr_type PtrType; typedef struct __go_func_type FuncType; -typedef struct __go_interface_type InterfaceType; typedef struct __go_map_type MapType; -typedef struct __go_channel_type ChanType; typedef struct tracebackg Traceback; |