tree.h (TYPE_REF_IS_RVALUE): Define.

* tree.h (TYPE_REF_IS_RVALUE): Define.
	* dwarf2out.c (attr_checksum_ordered, is_type_die, is_comdat_die,
	should_move_die_to_comdat, prune_unused_types_walk): Handle
	DW_TAG_rvalue_reference_type like DW_TAG_reference_type.
	(modified_type_die, gen_reference_type_die): Emit
	DW_TAG_rvalue_reference_type instead of DW_TAG_reference_type
	if TYPE_REF_IS_RVALUE and -gdwarf-4.

	* cp-tree.h (TYPE_REF_IS_RVALUE): Remove.

	* g++.dg/debug/dwarf2/rv1.C: New test.

From-SVN: r158542
This commit is contained in:
Jakub Jelinek 2010-04-20 10:33:47 +02:00 committed by Jakub Jelinek
parent 72e2cf1629
commit 1197ce8e5a
7 changed files with 56 additions and 8 deletions

View file

@ -1,3 +1,13 @@
2010-04-20 Jakub Jelinek <jakub@redhat.com>
* tree.h (TYPE_REF_IS_RVALUE): Define.
* dwarf2out.c (attr_checksum_ordered, is_type_die, is_comdat_die,
should_move_die_to_comdat, prune_unused_types_walk): Handle
DW_TAG_rvalue_reference_type like DW_TAG_reference_type.
(modified_type_die, gen_reference_type_die): Emit
DW_TAG_rvalue_reference_type instead of DW_TAG_reference_type
if TYPE_REF_IS_RVALUE and -gdwarf-4.
2010-04-20 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR target/43635

View file

@ -1,3 +1,7 @@
2010-04-20 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2010-04-19 Dodji Seketeli <dodji@redhat.com>
PR c++/43704

View file

@ -74,7 +74,6 @@ framework extensions, you must include this file before toplev.h, not after.
BASELINK_QUALIFIED_P (in BASELINK)
TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR)
TEMPLATE_PARM_PARAMETER_PACK (in TEMPLATE_PARM_INDEX)
TYPE_REF_IS_RVALUE (in REFERENCE_TYPE)
ATTR_IS_DEPENDENT (in the TREE_LIST for an attribute)
CONSTRUCTOR_IS_DIRECT_INIT (in CONSTRUCTOR)
LAMBDA_EXPR_CAPTURES_THIS_P (in LAMBDA_EXPR)
@ -3200,10 +3199,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define TYPE_REF_OBJ_P(NODE) \
(TREE_CODE (NODE) == REFERENCE_TYPE && TYPE_OBJ_P (TREE_TYPE (NODE)))
/* True if reference type NODE is an rvalue reference */
#define TYPE_REF_IS_RVALUE(NODE) \
TREE_LANG_FLAG_0 (REFERENCE_TYPE_CHECK (NODE))
/* Returns true if NODE is a pointer to an object, or a pointer to
void. Keep these checks in ascending tree code order. */
#define TYPE_PTROBV_P(NODE) \

View file

@ -8245,6 +8245,7 @@ attr_checksum_ordered (enum dwarf_tag tag, dw_attr_ref at,
if ((at->dw_attr == DW_AT_type
&& (tag == DW_TAG_pointer_type
|| tag == DW_TAG_reference_type
|| tag == DW_TAG_rvalue_reference_type
|| tag == DW_TAG_ptr_to_member_type))
|| (at->dw_attr == DW_AT_friend
&& tag == DW_TAG_friend))
@ -8959,6 +8960,7 @@ is_type_die (dw_die_ref die)
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_reference_type:
case DW_TAG_rvalue_reference_type:
case DW_TAG_string_type:
case DW_TAG_structure_type:
case DW_TAG_subroutine_type:
@ -8996,6 +8998,7 @@ is_comdat_die (dw_die_ref c)
if (c->die_tag == DW_TAG_pointer_type
|| c->die_tag == DW_TAG_reference_type
|| c->die_tag == DW_TAG_rvalue_reference_type
|| c->die_tag == DW_TAG_const_type
|| c->die_tag == DW_TAG_volatile_type)
{
@ -9244,6 +9247,7 @@ should_move_die_to_comdat (dw_die_ref die)
case DW_TAG_interface_type:
case DW_TAG_pointer_type:
case DW_TAG_reference_type:
case DW_TAG_rvalue_reference_type:
case DW_TAG_string_type:
case DW_TAG_subroutine_type:
case DW_TAG_ptr_to_member_type:
@ -12192,7 +12196,11 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
}
else if (code == REFERENCE_TYPE)
{
mod_type_die = new_die (DW_TAG_reference_type, comp_unit_die, type);
if (TYPE_REF_IS_RVALUE (type) && dwarf_version >= 4)
mod_type_die = new_die (DW_TAG_rvalue_reference_type, comp_unit_die,
type);
else
mod_type_die = new_die (DW_TAG_reference_type, comp_unit_die, type);
add_AT_unsigned (mod_type_die, DW_AT_byte_size,
simple_type_size_in_bits (type) / BITS_PER_UNIT);
item_type = TREE_TYPE (type);
@ -18634,8 +18642,12 @@ gen_pointer_type_die (tree type, dw_die_ref context_die)
static void
gen_reference_type_die (tree type, dw_die_ref context_die)
{
dw_die_ref ref_die
= new_die (DW_TAG_reference_type, scope_die_for (type, context_die), type);
dw_die_ref ref_die, scope_die = scope_die_for (type, context_die);
if (TYPE_REF_IS_RVALUE (type) && dwarf_version >= 4)
ref_die = new_die (DW_TAG_rvalue_reference_type, scope_die, type);
else
ref_die = new_die (DW_TAG_reference_type, scope_die, type);
equate_type_number_to_die (type, ref_die);
add_type_attribute (ref_die, TREE_TYPE (type), 0, 0, context_die);
@ -20907,6 +20919,7 @@ prune_unused_types_walk (dw_die_ref die)
case DW_TAG_packed_type:
case DW_TAG_pointer_type:
case DW_TAG_reference_type:
case DW_TAG_rvalue_reference_type:
case DW_TAG_volatile_type:
case DW_TAG_typedef:
case DW_TAG_array_type:

View file

@ -1,3 +1,7 @@
2010-04-20 Jakub Jelinek <jakub@redhat.com>
* g++.dg/debug/dwarf2/rv1.C: New test.
2010-04-20 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR target/43635

View file

@ -0,0 +1,15 @@
// { dg-do compile }
// { dg-options "-g -dA -gdwarf-4 -std=c++0x" }
// { dg-final { scan-assembler-times "DIE\[^\n\r\]*DW_TAG_reference_type" 1 } }
// { dg-final { scan-assembler-times "DIE\[^\n\r\]*DW_TAG_rvalue_reference_type" 1 } }
struct A { A (); ~A (); };
struct B { B (); ~B (); };
void
foo ()
{
A v;
A &a = v;
B &&b = B ();
}

View file

@ -504,6 +504,9 @@ struct GTY(()) tree_common {
OMP_CLAUSE_PRIVATE_OUTER_REF in
OMP_CLAUSE_PRIVATE
TYPE_REF_IS_RVALUE in
REFERENCE_TYPE
protected_flag:
TREE_PROTECTED in
@ -1347,6 +1350,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
/* Used in classes in C++. */
#define TREE_PROTECTED(NODE) ((NODE)->base.protected_flag)
/* True if reference type NODE is a C++ rvalue reference. */
#define TYPE_REF_IS_RVALUE(NODE) \
(REFERENCE_TYPE_CHECK (NODE)->base.private_flag)
/* Nonzero in a _DECL if the use of the name is defined as a
deprecated feature by __attribute__((deprecated)). */
#define TREE_DEPRECATED(NODE) \