-/* An object that maps a gdb type to a gcc type. */
-
-struct type_map_instance
-{
- /* The gdb type. */
-
- struct type *type;
-
- /* The corresponding gcc type handle. */
-
- gcc_type gcc_type_handle;
-};
-
-/* Hash a type_map_instance. */
-
-static hashval_t
-hash_type_map_instance (const void *p)
-{
- const struct type_map_instance *inst = (const struct type_map_instance *) p;
-
- return htab_hash_pointer (inst->type);
-}
-
-/* Check two type_map_instance objects for equality. */
-
-static int
-eq_type_map_instance (const void *a, const void *b)
-{
- const struct type_map_instance *insta = (const struct type_map_instance *) a;
- const struct type_map_instance *instb = (const struct type_map_instance *) b;
-
- return insta->type == instb->type;
-}
-
-\f
-
-/* Insert an entry into the type map associated with CONTEXT that maps
- from the gdb type TYPE to the gcc type GCC_TYPE. It is ok for a
- given type to be inserted more than once, provided that the exact
- same association is made each time. This simplifies how type
- caching works elsewhere in this file -- see how struct type caching
- is handled. */
-
-static void
-insert_type (struct compile_c_instance *context, struct type *type,
- gcc_type gcc_type)
-{
- struct type_map_instance inst, *add;
- void **slot;
-
- inst.type = type;
- inst.gcc_type_handle = gcc_type;
- slot = htab_find_slot (context->type_map, &inst, INSERT);
-
- add = (struct type_map_instance *) *slot;
- /* The type might have already been inserted in order to handle
- recursive types. */
- if (add != NULL && add->gcc_type_handle != gcc_type)
- error (_("Unexpected type id from GCC, check you use recent enough GCC."));
-
- if (add == NULL)
- {
- add = XNEW (struct type_map_instance);
- *add = inst;
- *slot = add;
- }
-}
-