+/* What about types defined as forward references inside of a small lexical
+ scope? */
+/* Add a type to the list of undefined types to be checked through
+ once this file has been read in.
+
+ In practice, we actually maintain two such lists: The first list
+ (UNDEF_TYPES) is used for types whose name has been provided, and
+ concerns forward references (eg 'xs' or 'xu' forward references);
+ the second list (NONAME_UNDEFS) is used for types whose name is
+ unknown at creation time, because they were referenced through
+ their type number before the actual type was declared.
+ This function actually adds the given type to the proper list. */
+
+static void
+add_undefined_type (struct type *type, int typenums[2])
+{
+ if (TYPE_TAG_NAME (type) == NULL)
+ add_undefined_type_noname (type, typenums);
+ else
+ add_undefined_type_1 (type);
+}
+
+/* Try to fix all undefined types pushed on the UNDEF_TYPES vector. */
+
+void
+cleanup_undefined_types_noname (void)
+{
+ int i;
+
+ for (i = 0; i < noname_undefs_length; i++)
+ {
+ struct nat nat = noname_undefs[i];
+ struct type **type;
+
+ type = dbx_lookup_type (nat.typenums);
+ if (nat.type != *type && TYPE_CODE (*type) != TYPE_CODE_UNDEF)
+ {
+ /* The instance flags of the undefined type are still unset,
+ and needs to be copied over from the reference type.
+ Since replace_type expects them to be identical, we need
+ to set these flags manually before hand. */
+ TYPE_INSTANCE_FLAGS (nat.type) = TYPE_INSTANCE_FLAGS (*type);
+ replace_type (nat.type, *type);
+ }
+ }
+
+ noname_undefs_length = 0;
+}
+