aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2019-05-13 11:56:57 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-05-13 11:56:57 +0000
commitf78f5d239203d0da6638bc5e20080971d61d09d9 (patch)
tree42891296f28dbb6189515d2a42eb6aaa464d9d3c /gcc/dwarf2out.c
parent61021c35c0b3ca3f37ad23002083d4f6c70e1bd1 (diff)
downloadgcc-f78f5d239203d0da6638bc5e20080971d61d09d9.zip
gcc-f78f5d239203d0da6638bc5e20080971d61d09d9.tar.gz
gcc-f78f5d239203d0da6638bc5e20080971d61d09d9.tar.bz2
[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
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 5b1a32b..e5d8ebc 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -8576,11 +8576,12 @@ break_out_comdat_types (dw_die_ref die)
/* Break out nested types into their own type units. */
break_out_comdat_types (c);
- /* Create a new type unit DIE as the root for the new tree, and
- add it to the list of comdat types. */
+ /* Create a new type unit DIE as the root for the new tree. */
unit = new_die (DW_TAG_type_unit, NULL, NULL);
add_AT_unsigned (unit, 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->root_die = unit;
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",
((XINT (rtl, 1) >= 0 && XINT (rtl, 1) < NUM_UNSPEC_VALUES)
? unspec_strings[XINT (rtl, 1)] : "unknown"),
- XINT (rtl, 1));
#else
"non-delegitimized UNSPEC %d found in variable location",
- XINT (rtl, 1));
#endif
+ XINT (rtl, 1));
expansion_failed (NULL_TREE, rtl,
"UNSPEC hasn't been delegitimized.\n");
return false;
@@ -25161,19 +25161,20 @@ gen_member_die (tree type, dw_die_ref 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))
{
+ /* Ignore clones. */
+ if (DECL_ABSTRACT_ORIGIN (member))
+ continue;
+
struct vlr_context vlr_ctx = { type, NULL_TREE };
bool static_inline_p
- = (TREE_STATIC (member)
+ = (VAR_P (member)
+ && TREE_STATIC (member)
&& (lang_hooks.decls.decl_dwarf_attribute (member, DW_AT_inline)
!= -1));
- /* Ignore clones. */
- if (DECL_ABSTRACT_ORIGIN (member))
- continue;
-
/* If we thought we were generating minimal debug info for TYPE
and then changed our minds, some of the member declarations
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
declarations. */
- dw_die_ref ref = NULL;
+ bool splice = true;
+
+ dw_die_ref ref = NULL;
if (child->die_tag == DW_TAG_variable
&& child->die_parent == comp_unit_die ())
{
ref = get_AT_ref (child, DW_AT_specification);
+
/* For C++17 inline static data members followed by redundant
out of class redeclaration, we might get here with
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;
static_inline_p = false;
}
- }
- if (child->die_tag == DW_TAG_variable
- && child->die_parent == comp_unit_die ()
- && ref == NULL)
- {
- reparent_child (child, context_die);
- if (dwarf_version < 5)
- child->die_tag = DW_TAG_member;
+ if (!ref)
+ {
+ reparent_child (child, context_die);
+ if (dwarf_version < 5)
+ child->die_tag = DW_TAG_member;
+ splice = false;
+ }
}
- else
+
+ if (splice)
splice_child_die (context_die, child);
}