aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils.cc')
-rw-r--r--gcc/ada/gcc-interface/utils.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index a06366b..3a571e0 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -2846,11 +2846,13 @@ create_type_stub_decl (tree name, tree type)
used in the declaration. ARTIFICIAL_P is true if the declaration was
generated by the compiler. DEBUG_INFO_P is true if we need to write
debug information about this type. GNAT_NODE is used for the position
- of the decl. */
+ of the decl. Normally, an artificial type might be marked as
+ nameless. However, if CAN_BE_NAMELESS is false, this marking is
+ disabled and the name will always be attached for the type. */
tree
create_type_decl (tree name, tree type, bool artificial_p, bool debug_info_p,
- Node_Id gnat_node)
+ Node_Id gnat_node, bool can_be_nameless)
{
enum tree_code code = TREE_CODE (type);
bool is_named
@@ -2872,6 +2874,9 @@ create_type_decl (tree name, tree type, bool artificial_p, bool debug_info_p,
DECL_ARTIFICIAL (type_decl) = artificial_p;
TYPE_ARTIFICIAL (type) = artificial_p;
+ DECL_NAMELESS (type_decl) = (artificial_p
+ && can_be_nameless
+ && gnat_encodings != DWARF_GNAT_ENCODINGS_ALL);
/* Add this decl to the current binding level. */
gnat_pushdecl (type_decl, gnat_node);