Commit bc712852 by Eric Botcazou Committed by Eric Botcazou

tree.h (TYPE_ARTIFICIAL): New flag.

	* tree.h (TYPE_ARTIFICIAL): New flag.
	* dwarf2out.c (modified_type_die): Add a DW_AT_artificial attribute to
	the DIE of the type if it is artificial.
	(gen_array_type_die): Likewise.
	(gen_enumeration_type_die): Likewise.
	(gen_struct_or_union_type_die): Likewise.
	* lto-streamer-in.c (unpack_ts_base_value_fields): Use TYPE_ARTIFICIAL.
	* lto-streamer-out.c (pack_ts_base_value_fields): Likewise.
ada/
	* gcc-interface/utils.c (record_builtin_type): Set TYPE_ARTIFICIAL on
	the type according to the ARTIFICIAL_P parameter.
	(create_type_decl): Likewise.
	(create_type_stub_decl): Set TYPE_ARTIFICIAL on the type to 1.

Co-Authored-By: Nicolas Setton <setton@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r175781
parent 49860194
2011-07-02 Eric Botcazou <ebotcazou@adacore.com>
Olivier Hainque <hainque@adacore.com>
Nicolas Setton <setton@adacore.com>
* tree.h (TYPE_ARTIFICIAL): New flag.
* dwarf2out.c (modified_type_die): Add a DW_AT_artificial attribute to
the DIE of the type if it is artificial.
(gen_array_type_die): Likewise.
(gen_enumeration_type_die): Likewise.
(gen_struct_or_union_type_die): Likewise.
* lto-streamer-in.c (unpack_ts_base_value_fields): Use TYPE_ARTIFICIAL.
* lto-streamer-out.c (pack_ts_base_value_fields): Likewise.
2011-07-01 Jakub Jelinek <jakub@redhat.com>
* tree-object-size.c (pass_through_call): Handle
......
2011-07-02 Eric Botcazou <ebotcazou@adacore.com>
Olivier Hainque <hainque@adacore.com>
Nicolas Setton <setton@adacore.com>
* gcc-interface/utils.c (record_builtin_type): Set TYPE_ARTIFICIAL on
the type according to the ARTIFICIAL_P parameter.
(create_type_decl): Likewise.
(create_type_stub_decl): Set TYPE_ARTIFICIAL on the type to 1.
2011-07-01 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Make-lang.in (gnat1): Prepend '+' to the command.
......
......@@ -614,6 +614,7 @@ record_builtin_type (const char *name, tree type, bool artificial_p)
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)
......@@ -1297,6 +1298,7 @@ create_type_stub_decl (tree type_name, tree type)
tree type_decl = build_decl (input_location,
TYPE_DECL, type_name, type);
DECL_ARTIFICIAL (type_decl) = 1;
TYPE_ARTIFICIAL (type) = 1;
return type_decl;
}
......@@ -1329,6 +1331,7 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list,
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);
......
......@@ -13189,6 +13189,8 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
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)
......@@ -19444,6 +19446,8 @@ gen_array_type_die (tree type, dw_die_ref context_die)
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)
......@@ -19747,6 +19751,8 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
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))
......@@ -21604,6 +21610,8 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_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);
}
}
else
......
......@@ -1563,7 +1563,10 @@ unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
else
bp_unpack_value (bp, 1);
TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TYPE_P (expr))
TYPE_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
else
TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_USED (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
......
......@@ -340,7 +340,10 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
bp_pack_value (bp, 0, 1);
/* We write debug info two times, do not confuse the second one. */
bp_pack_value (bp, TYPE_P (expr) ? 0 : TREE_ASM_WRITTEN (expr), 1);
bp_pack_value (bp, TREE_NO_WARNING (expr), 1);
if (TYPE_P (expr))
bp_pack_value (bp, TYPE_ARTIFICIAL (expr), 1);
else
bp_pack_value (bp, TREE_NO_WARNING (expr), 1);
bp_pack_value (bp, TREE_USED (expr), 1);
bp_pack_value (bp, TREE_NOTHROW (expr), 1);
bp_pack_value (bp, TREE_STATIC (expr), 1);
......
2011-07-02 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/debug1.ads: New test.
2011-07-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/49562
......
-- { dg-do compile { target *-*-linux* } }
-- { dg-options "-gdwarf-2 -cargs -dA" }
package Debug1 is
function N return Integer;
pragma Import (Ada, N);
type Arr is array (-N .. N) of Boolean;
A : Arr;
end Debug1;
-- { dg-final { scan-assembler-times "byte\t0x1\t# DW_AT_artificial" 4 } }
......@@ -699,6 +699,9 @@ struct GTY(()) tree_common {
all expressions
all decls
TYPE_ARTIFICIAL in
all types
default_def_flag:
TYPE_VECTOR_OPAQUE in
......@@ -1243,6 +1246,9 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
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) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment