aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/gcc-interface/utils.c3
-rw-r--r--gcc/dwarf2out.c8
-rw-r--r--gcc/lto-streamer-in.c5
-rw-r--r--gcc/lto-streamer-out.c5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/specs/debug1.ads14
-rw-r--r--gcc/tree.h6
9 files changed, 65 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 90433ee..63f2bd3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+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
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d21f2e0..9e778c1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+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.
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index e749632..9b6e721 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -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);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9ab551d..a0714c4 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 25ccb24..7a4f722 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -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);
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 19b0ae8..6345d83 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9254235..8460d89 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+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
diff --git a/gcc/testsuite/gnat.dg/specs/debug1.ads b/gcc/testsuite/gnat.dg/specs/debug1.ads
new file mode 100644
index 0000000..30ccf28
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/debug1.ads
@@ -0,0 +1,14 @@
+-- { 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 } }
diff --git a/gcc/tree.h b/gcc/tree.h
index 20ba295..ab0b6cc 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -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) \