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.

Change-Id: Id6a0380faf40f41fb73b0807e23ffebf60573011
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179858
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 8a3844c..6324170 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -469,7 +469,6 @@
 	runtime/go-setenv.c \
 	runtime/go-signal.c \
 	runtime/go-strslice.c \
-	runtime/go-typedesc-equal.c \
 	runtime/go-unsafe-pointer.c \
 	runtime/go-unsetenv.c \
 	runtime/go-unwind.c \
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 20e2a49..08a3926 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -248,13 +248,12 @@
 	runtime/go-nanotime.lo runtime/go-now.lo runtime/go-nosys.lo \
 	runtime/go-reflect-call.lo runtime/go-runtime-error.lo \
 	runtime/go-setenv.lo runtime/go-signal.lo \
-	runtime/go-strslice.lo runtime/go-typedesc-equal.lo \
-	runtime/go-unsafe-pointer.lo runtime/go-unsetenv.lo \
-	runtime/go-unwind.lo runtime/go-varargs.lo \
-	runtime/env_posix.lo runtime/panic.lo runtime/print.lo \
-	runtime/proc.lo runtime/runtime_c.lo runtime/stack.lo \
-	runtime/yield.lo runtime/go-context.lo $(am__objects_1) \
-	$(am__objects_2)
+	runtime/go-strslice.lo runtime/go-unsafe-pointer.lo \
+	runtime/go-unsetenv.lo runtime/go-unwind.lo \
+	runtime/go-varargs.lo runtime/env_posix.lo runtime/panic.lo \
+	runtime/print.lo runtime/proc.lo runtime/runtime_c.lo \
+	runtime/stack.lo runtime/yield.lo runtime/go-context.lo \
+	$(am__objects_1) $(am__objects_2)
 am_libgo_llgo_la_OBJECTS = $(am__objects_3)
 libgo_llgo_la_OBJECTS = $(am_libgo_llgo_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
@@ -526,7 +525,6 @@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
-runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -904,7 +902,6 @@
 	runtime/go-setenv.c \
 	runtime/go-signal.c \
 	runtime/go-strslice.c \
-	runtime/go-typedesc-equal.c \
 	runtime/go-unsafe-pointer.c \
 	runtime/go-unsetenv.c \
 	runtime/go-unwind.c \
@@ -1367,8 +1364,6 @@
 	runtime/$(DEPDIR)/$(am__dirstamp)
 runtime/go-strslice.lo: runtime/$(am__dirstamp) \
 	runtime/$(DEPDIR)/$(am__dirstamp)
-runtime/go-typedesc-equal.lo: runtime/$(am__dirstamp) \
-	runtime/$(DEPDIR)/$(am__dirstamp)
 runtime/go-unsafe-pointer.lo: runtime/$(am__dirstamp) \
 	runtime/$(DEPDIR)/$(am__dirstamp)
 runtime/go-unsetenv.lo: runtime/$(am__dirstamp) \
@@ -1454,7 +1449,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-setenv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-signal.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-strslice.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-typedesc-equal.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsafe-pointer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsetenv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unwind.Plo@am__quote@
diff --git a/libgo/configure b/libgo/configure
index 837f6fe..22ef79c 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -813,7 +813,6 @@
 docdir
 oldincludedir
 includedir
-runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -895,7 +894,6 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1148,15 +1146,6 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
-  | --runstate | --runstat | --runsta | --runst | --runs \
-  | --run | --ru | --r)
-    ac_prev=runstatedir ;;
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
-  | --run=* | --ru=* | --r=*)
-    runstatedir=$ac_optarg ;;
-
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1294,7 +1283,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir runstatedir
+		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1447,7 +1436,6 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -11496,7 +11484,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11499 "configure"
+#line 11487 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11602,7 +11590,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11605 "configure"
+#line 11593 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
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_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_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 @@
   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	__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;
 
diff --git a/libgo/testsuite/Makefile.in b/libgo/testsuite/Makefile.in
index 4b4d07d..41d81b5 100644
--- a/libgo/testsuite/Makefile.in
+++ b/libgo/testsuite/Makefile.in
@@ -276,7 +276,6 @@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
-runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@