[DWARF] dwarf2out cleanups
https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00485.html * dwarf2out.c (breakout_comdat_types): Move comment to correct piece of code. (const_ok_for_output_1): Balance parens around #if/#else/#endif (gen_member_die): Move abstract origin check earlier. Only VARs can be static_inline_p. Simplify splicing control flow. From-SVN: r271127
This commit is contained in:
parent
61021c35c0
commit
f78f5d2392
|
@ -1,3 +1,11 @@
|
||||||
|
2019-05-13 Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
|
* dwarf2out.c (breakout_comdat_types): Move comment to correct
|
||||||
|
piece of code.
|
||||||
|
(const_ok_for_output_1): Balance parens around #if/#else/#endif
|
||||||
|
(gen_member_die): Move abstract origin check earlier. Only VARs
|
||||||
|
can be static_inline_p. Simplify splicing control flow.
|
||||||
|
|
||||||
2019-05-13 Richard Biener <rguenther@suse.de>
|
2019-05-13 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
* tree-vect-slp.c (vect_get_and_check_slp_defs): Handle
|
* tree-vect-slp.c (vect_get_and_check_slp_defs): Handle
|
||||||
|
|
|
@ -8576,11 +8576,12 @@ break_out_comdat_types (dw_die_ref die)
|
||||||
/* Break out nested types into their own type units. */
|
/* Break out nested types into their own type units. */
|
||||||
break_out_comdat_types (c);
|
break_out_comdat_types (c);
|
||||||
|
|
||||||
/* Create a new type unit DIE as the root for the new tree, and
|
/* Create a new type unit DIE as the root for the new tree. */
|
||||||
add it to the list of comdat types. */
|
|
||||||
unit = new_die (DW_TAG_type_unit, NULL, NULL);
|
unit = new_die (DW_TAG_type_unit, NULL, NULL);
|
||||||
add_AT_unsigned (unit, DW_AT_language,
|
add_AT_unsigned (unit, DW_AT_language,
|
||||||
get_AT_unsigned (comp_unit_die (), DW_AT_language));
|
get_AT_unsigned (comp_unit_die (), DW_AT_language));
|
||||||
|
|
||||||
|
/* Add the new unit's type DIE into the comdat type list. */
|
||||||
type_node = ggc_cleared_alloc<comdat_type_node> ();
|
type_node = ggc_cleared_alloc<comdat_type_node> ();
|
||||||
type_node->root_die = unit;
|
type_node->root_die = unit;
|
||||||
type_node->next = comdat_type_list;
|
type_node->next = comdat_type_list;
|
||||||
|
@ -14509,11 +14510,10 @@ const_ok_for_output_1 (rtx rtl)
|
||||||
"non-delegitimized UNSPEC %s (%d) found in variable location",
|
"non-delegitimized UNSPEC %s (%d) found in variable location",
|
||||||
((XINT (rtl, 1) >= 0 && XINT (rtl, 1) < NUM_UNSPEC_VALUES)
|
((XINT (rtl, 1) >= 0 && XINT (rtl, 1) < NUM_UNSPEC_VALUES)
|
||||||
? unspec_strings[XINT (rtl, 1)] : "unknown"),
|
? unspec_strings[XINT (rtl, 1)] : "unknown"),
|
||||||
XINT (rtl, 1));
|
|
||||||
#else
|
#else
|
||||||
"non-delegitimized UNSPEC %d found in variable location",
|
"non-delegitimized UNSPEC %d found in variable location",
|
||||||
XINT (rtl, 1));
|
|
||||||
#endif
|
#endif
|
||||||
|
XINT (rtl, 1));
|
||||||
expansion_failed (NULL_TREE, rtl,
|
expansion_failed (NULL_TREE, rtl,
|
||||||
"UNSPEC hasn't been delegitimized.\n");
|
"UNSPEC hasn't been delegitimized.\n");
|
||||||
return false;
|
return false;
|
||||||
|
@ -25161,19 +25161,20 @@ gen_member_die (tree type, dw_die_ref context_die)
|
||||||
context_die);
|
context_die);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now output info about the data members and type members. */
|
/* Now output info about the members. */
|
||||||
for (member = TYPE_FIELDS (type); member; member = DECL_CHAIN (member))
|
for (member = TYPE_FIELDS (type); member; member = DECL_CHAIN (member))
|
||||||
{
|
{
|
||||||
struct vlr_context vlr_ctx = { type, NULL_TREE };
|
|
||||||
bool static_inline_p
|
|
||||||
= (TREE_STATIC (member)
|
|
||||||
&& (lang_hooks.decls.decl_dwarf_attribute (member, DW_AT_inline)
|
|
||||||
!= -1));
|
|
||||||
|
|
||||||
/* Ignore clones. */
|
/* Ignore clones. */
|
||||||
if (DECL_ABSTRACT_ORIGIN (member))
|
if (DECL_ABSTRACT_ORIGIN (member))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
struct vlr_context vlr_ctx = { type, NULL_TREE };
|
||||||
|
bool static_inline_p
|
||||||
|
= (VAR_P (member)
|
||||||
|
&& TREE_STATIC (member)
|
||||||
|
&& (lang_hooks.decls.decl_dwarf_attribute (member, DW_AT_inline)
|
||||||
|
!= -1));
|
||||||
|
|
||||||
/* If we thought we were generating minimal debug info for TYPE
|
/* If we thought we were generating minimal debug info for TYPE
|
||||||
and then changed our minds, some of the member declarations
|
and then changed our minds, some of the member declarations
|
||||||
may have already been defined. Don't define them again, but
|
may have already been defined. Don't define them again, but
|
||||||
|
@ -25183,11 +25184,14 @@ gen_member_die (tree type, dw_die_ref context_die)
|
||||||
{
|
{
|
||||||
/* Handle inline static data members, which only have in-class
|
/* Handle inline static data members, which only have in-class
|
||||||
declarations. */
|
declarations. */
|
||||||
dw_die_ref ref = NULL;
|
bool splice = true;
|
||||||
|
|
||||||
|
dw_die_ref ref = NULL;
|
||||||
if (child->die_tag == DW_TAG_variable
|
if (child->die_tag == DW_TAG_variable
|
||||||
&& child->die_parent == comp_unit_die ())
|
&& child->die_parent == comp_unit_die ())
|
||||||
{
|
{
|
||||||
ref = get_AT_ref (child, DW_AT_specification);
|
ref = get_AT_ref (child, DW_AT_specification);
|
||||||
|
|
||||||
/* For C++17 inline static data members followed by redundant
|
/* For C++17 inline static data members followed by redundant
|
||||||
out of class redeclaration, we might get here with
|
out of class redeclaration, we might get here with
|
||||||
child being the DIE created for the out of class
|
child being the DIE created for the out of class
|
||||||
|
@ -25206,17 +25210,17 @@ gen_member_die (tree type, dw_die_ref context_die)
|
||||||
ref = NULL;
|
ref = NULL;
|
||||||
static_inline_p = false;
|
static_inline_p = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ref)
|
||||||
|
{
|
||||||
|
reparent_child (child, context_die);
|
||||||
|
if (dwarf_version < 5)
|
||||||
|
child->die_tag = DW_TAG_member;
|
||||||
|
splice = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child->die_tag == DW_TAG_variable
|
if (splice)
|
||||||
&& child->die_parent == comp_unit_die ()
|
|
||||||
&& ref == NULL)
|
|
||||||
{
|
|
||||||
reparent_child (child, context_die);
|
|
||||||
if (dwarf_version < 5)
|
|
||||||
child->die_tag = DW_TAG_member;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
splice_child_die (context_die, child);
|
splice_child_die (context_die, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue