tree.h: Remove DECL_BY_REFERENCE from private_flag comment.

* tree.h: Remove DECL_BY_REFERENCE from private_flag comment.
	(struct tree_base): Adjust spacing for 8 bit boundaries.
	(struct tree_decl_common): Add decl_by_reference_flag bit.
	(DECL_BY_REFERENCE): Adjust.
	* print-tree.c (print_node): For VAR_DECL, PARM_DECL or RESULT_DECL,
	print DECL_BY_REFERENCE bit.
	* dbxout.c (DECL_ACCESSIBILITY_CHAR): Revert last change.
	* dwarf2out.c (loc_by_reference, gen_decl_die): Check
	DECL_BY_REFERENCE for all VAR_DECLs, not just non-static ones.
	(gen_variable_die): Likewise.  Check TREE_PRIVATE/TREE_PROTECTED
	unconditionally.

From-SVN: r147135
This commit is contained in:
Jakub Jelinek 2009-05-05 23:07:05 +02:00 committed by Jakub Jelinek
parent 21c3348aea
commit 6e57a01df4
5 changed files with 33 additions and 22 deletions

View File

@ -1,3 +1,17 @@
2009-05-05 Jakub Jelinek <jakub@redhat.com>
* tree.h: Remove DECL_BY_REFERENCE from private_flag comment.
(struct tree_base): Adjust spacing for 8 bit boundaries.
(struct tree_decl_common): Add decl_by_reference_flag bit.
(DECL_BY_REFERENCE): Adjust.
* print-tree.c (print_node): For VAR_DECL, PARM_DECL or RESULT_DECL,
print DECL_BY_REFERENCE bit.
* dbxout.c (DECL_ACCESSIBILITY_CHAR): Revert last change.
* dwarf2out.c (loc_by_reference, gen_decl_die): Check
DECL_BY_REFERENCE for all VAR_DECLs, not just non-static ones.
(gen_variable_die): Likewise. Check TREE_PRIVATE/TREE_PROTECTED
unconditionally.
2009-05-05 Joseph Myers <joseph@codesourcery.com>
* dwarf.h: Remove.

View File

@ -1398,9 +1398,7 @@ dbxout_type_index (tree type)
/* Used in several places: evaluates to '0' for a private decl,
'1' for a protected decl, '2' for a public decl. */
#define DECL_ACCESSIBILITY_CHAR(DECL) \
((TREE_CODE (DECL) != PARM_DECL && TREE_CODE (DECL) != RESULT_DECL \
&& (TREE_CODE (DECL) != VAR_DECL || TREE_STATIC (DECL)) \
&& TREE_PRIVATE (DECL)) ? '0' : TREE_PROTECTED (DECL) ? '1' : '2')
(TREE_PRIVATE (DECL) ? '0' : TREE_PROTECTED (DECL) ? '1' : '2')
/* Subroutine of `dbxout_type'. Output the type fields of TYPE.
This must be a separate function because anonymous unions require

View File

@ -11715,7 +11715,7 @@ loc_by_reference (dw_loc_descr_ref loc, tree decl)
if ((TREE_CODE (decl) != PARM_DECL
&& TREE_CODE (decl) != RESULT_DECL
&& (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl)))
&& TREE_CODE (decl) != VAR_DECL)
|| !DECL_BY_REFERENCE (decl))
return loc;
@ -14048,19 +14048,13 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
else
{
tree type = TREE_TYPE (decl);
bool private_flag_valid = true;
add_name_and_src_coords_attributes (var_die, decl);
if ((TREE_CODE (decl) == PARM_DECL
|| TREE_CODE (decl) == RESULT_DECL
|| (TREE_CODE (decl) == VAR_DECL && !TREE_STATIC (decl)))
|| TREE_CODE (decl) == VAR_DECL)
&& DECL_BY_REFERENCE (decl))
{
add_type_attribute (var_die, TREE_TYPE (type), 0, 0, context_die);
/* DECL_BY_REFERENCE uses the same bit as TREE_PRIVATE,
for PARM_DECL, RESULT_DECL or non-static VAR_DECL. */
private_flag_valid = false;
}
add_type_attribute (var_die, TREE_TYPE (type), 0, 0, context_die);
else
add_type_attribute (var_die, type, TREE_READONLY (decl),
TREE_THIS_VOLATILE (decl), context_die);
@ -14073,7 +14067,7 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
if (TREE_PROTECTED (decl))
add_AT_unsigned (var_die, DW_AT_accessibility, DW_ACCESS_protected);
else if (private_flag_valid && TREE_PRIVATE (decl))
else if (TREE_PRIVATE (decl))
add_AT_unsigned (var_die, DW_AT_accessibility, DW_ACCESS_private);
}
@ -15307,8 +15301,7 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die)
/* Output any DIEs that are needed to specify the type of this data
object. */
if ((TREE_CODE (decl_or_origin) == RESULT_DECL
|| (TREE_CODE (decl_or_origin) == VAR_DECL
&& !TREE_STATIC (decl_or_origin)))
|| TREE_CODE (decl_or_origin) == VAR_DECL)
&& DECL_BY_REFERENCE (decl_or_origin))
gen_type_die (TREE_TYPE (TREE_TYPE (decl_or_origin)), context_die);
else

View File

@ -448,6 +448,10 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
fprintf (file, " %s", GET_MODE_NAME (mode));
}
if ((code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL)
&& DECL_BY_REFERENCE (node))
fputs (" passed-by-reference", file);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS) && DECL_DEFER_OUTPUT (node))
fputs (" defer-output", file);

View File

@ -362,8 +362,8 @@ struct GTY(()) tree_base {
unsigned protected_flag : 1;
unsigned deprecated_flag : 1;
unsigned saturating_flag : 1;
unsigned default_def_flag : 1;
unsigned default_def_flag : 1;
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
unsigned lang_flag_2 : 1;
@ -371,6 +371,7 @@ struct GTY(()) tree_base {
unsigned lang_flag_4 : 1;
unsigned lang_flag_5 : 1;
unsigned lang_flag_6 : 1;
unsigned visited : 1;
unsigned spare : 23;
@ -475,9 +476,6 @@ struct GTY(()) tree_common {
CALL_EXPR_RETURN_SLOT_OPT in
CALL_EXPR
DECL_BY_REFERENCE in
PARM_DECL, RESULT_DECL, VAR_DECL (only !TREE_STATIC)
OMP_SECTION_LAST in
OMP_SECTION
@ -1294,10 +1292,12 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define CALL_EXPR_RETURN_SLOT_OPT(NODE) \
(CALL_EXPR_CHECK (NODE)->base.private_flag)
/* In a RESULT_DECL, PARM_DECL or VAR_DECL without TREE_STATIC, means that it is
/* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that it is
passed by invisible reference (and the TREE_TYPE is a pointer to the true
type). */
#define DECL_BY_REFERENCE(NODE) (DECL_COMMON_CHECK (NODE)->base.private_flag)
#define DECL_BY_REFERENCE(NODE) \
(TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
RESULT_DECL)->decl_common.decl_by_reference_flag)
/* In a CALL_EXPR, means that the call is the jump from a thunk to the
thunked-to function. */
@ -2651,8 +2651,10 @@ struct GTY(()) tree_decl_common {
unsigned gimple_reg_flag : 1;
/* In a DECL with pointer type, set if no TBAA should be done. */
unsigned no_tbaa_flag : 1;
/* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_BY_REFERENCE. */
unsigned decl_by_reference_flag : 1;
/* Padding so that 'off_align' can be on a 32-bit boundary. */
unsigned decl_common_unused : 2;
unsigned decl_common_unused : 1;
/* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */
unsigned int off_align : 8;