===================================================================
@@ -631,6 +631,9 @@ struct GTY(()) tree_common {
all expressions
all decls
+ TYPE_ARTIFICIAL in
+ all types
+
default_def_flag:
TYPE_VECTOR_OPAQUE in
@@ -1175,6 +1178,9 @@ extern void omp_clause_range_check_faile
emitted. */
#define TREE_NO_WARNING(NODE) ((NODE)->base.nowarning_flag)
+/* Used to indicate that this TYPE represents a compiler-generated entity. */
+#define TYPE_ARTIFICIAL(NODE) (TYPE_CHECK (NODE)->base.nowarning_flag)
+
/* In an IDENTIFIER_NODE, this means that assemble_name was called with
this string as an argument. */
#define TREE_SYMBOL_REFERENCED(NODE) \
===================================================================
@@ -12877,6 +12877,8 @@ modified_type_die (tree type, int is_con
name = DECL_NAME (name);
add_name_attribute (mod_type_die, IDENTIFIER_POINTER (name));
add_gnat_descriptive_type_attribute (mod_type_die, type, context_die);
+ if (TYPE_ARTIFICIAL (type))
+ add_AT_flag (mod_type_die, DW_AT_artificial, 1);
}
/* This probably indicates a bug. */
else if (mod_type_die && mod_type_die->die_tag == DW_TAG_base_type)
@@ -18234,6 +18236,8 @@ gen_array_type_die (tree type, dw_die_re
array_die = new_die (DW_TAG_array_type, scope_die, type);
add_name_attribute (array_die, type_tag (type));
add_gnat_descriptive_type_attribute (array_die, type, context_die);
+ if (TYPE_ARTIFICIAL (type))
+ add_AT_flag (array_die, DW_AT_artificial, 1);
equate_type_number_to_die (type, array_die);
if (TREE_CODE (type) == VECTOR_TYPE)
@@ -18537,6 +18541,8 @@ gen_enumeration_type_die (tree type, dw_
equate_type_number_to_die (type, type_die);
add_name_attribute (type_die, type_tag (type));
add_gnat_descriptive_type_attribute (type_die, type, context_die);
+ if (TYPE_ARTIFICIAL (type))
+ add_AT_flag (type_die, DW_AT_artificial, 1);
if (dwarf_version >= 4 || !dwarf_strict)
{
if (ENUM_IS_SCOPED (type))
@@ -20359,6 +20365,8 @@ gen_struct_or_union_type_die (tree type,
{
add_name_attribute (type_die, type_tag (type));
add_gnat_descriptive_type_attribute (type_die, type, context_die);
+ if (TYPE_ARTIFICIAL (type))
+ add_AT_flag (type_die, DW_AT_artificial, 1);
}
}
else
===================================================================
@@ -612,6 +612,7 @@ record_builtin_type (const char *name, t
tree type_decl = build_decl (input_location,
TYPE_DECL, get_identifier (name), type);
DECL_ARTIFICIAL (type_decl) = artificial_p;
+ TYPE_ARTIFICIAL (type) = artificial_p;
gnat_pushdecl (type_decl, Empty);
if (debug_hooks->type_decl)
@@ -1303,6 +1304,7 @@ create_type_stub_decl (tree type_name, t
tree type_decl = build_decl (input_location,
TYPE_DECL, type_name, type);
DECL_ARTIFICIAL (type_decl) = 1;
+ TYPE_ARTIFICIAL (type) = 1;
return type_decl;
}
@@ -1335,6 +1337,7 @@ create_type_decl (tree type_name, tree t
TYPE_DECL, type_name, type);
DECL_ARTIFICIAL (type_decl) = artificial_p;
+ TYPE_ARTIFICIAL (type) = artificial_p;
/* Add this decl to the current binding level. */
gnat_pushdecl (type_decl, gnat_node);