Get rid of meta_type_die, handle C++ specific TYPE_P trees like unspecified type.

This commit is contained in:
Jakub Jelinek
2025-12-05 19:03:28 +01:00
committed by Marek Polacek
parent 40df270f24
commit 0f02b5a29d

View File

@@ -282,9 +282,6 @@ static GTY(()) dw_die_ref auto_die;
/* The DIE for C++14 'decltype(auto)' in a function return type. */
static GTY(()) dw_die_ref decltype_auto_die;
/* The DIE for C++26 'decltype(^^int)' fundamental type. */
static GTY(()) dw_die_ref meta_type_die;
/* Forward declarations for functions defined in this file. */
static void output_call_frame_info (int);
@@ -13463,20 +13460,6 @@ is_cxx_auto (tree type)
return false;
}
/* Return true for C++ std::meta::info fundamental type. */
static inline bool
is_cxx_meta_type (tree type)
{
if (is_cxx ())
{
tree name = TYPE_IDENTIFIER (type);
if (name == get_identifier ("decltype(^^int)"))
return true;
}
return false;
}
/* Given a pointer to an arbitrary ..._TYPE tree node, return true if the
given input type is a Dwarf "fundamental" type. Otherwise return null. */
@@ -13511,9 +13494,10 @@ is_base_type (tree type)
return false;
default:
if (is_cxx_auto (type))
return false;
if (is_cxx_meta_type (type))
if (is_cxx ()
&& TREE_CODE (type) >= LAST_AND_UNUSED_TREE_CODE
&& TYPE_P (type)
&& TYPE_IDENTIFIER (type))
return false;
gcc_unreachable ();
}
@@ -26978,6 +26962,7 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
case NULLPTR_TYPE:
case LANG_TYPE:
unspecified_type:
/* Just use DW_TAG_unspecified_type. */
{
dw_die_ref type_die = lookup_type_die (type);
@@ -27007,18 +26992,11 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
equate_type_number_to_die (type, *die);
break;
}
if (is_cxx_meta_type (type))
{
tree name = TYPE_IDENTIFIER (type);
if (!meta_type_die)
{
meta_type_die = new_die (DW_TAG_unspecified_type,
comp_unit_die (), NULL_TREE);
add_name_attribute (meta_type_die, IDENTIFIER_POINTER (name));
}
equate_type_number_to_die (type, meta_type_die);
break;
}
if (is_cxx ()
&& TREE_CODE (type) >= LAST_AND_UNUSED_TREE_CODE
&& TYPE_P (type)
&& TYPE_IDENTIFIER (type))
goto unspecified_type;
gcc_unreachable ();
}