/* Create a stripped-down declaration, mainly for debugging. */
t = create_type_decl (gnu_entity_name, gnu_type, true, debug_info_p,
- gnat_entity);
+ gnat_entity, false);
/* Now save it and build the enclosing record type. */
gnu_field_type = gnu_type;
? create_concat_name (gnat_name, "XUP")
: gnu_entity_name;
create_type_decl (xup_name, gnu_fat_type, true, debug_info_p,
- gnat_entity);
+ gnat_entity, false);
/* Build a reference to the template from a PLACEHOLDER_EXPR that
is the fat pointer. This will be used to access the individual
= create_type_decl (gnu_entity_name, gnu_type,
is_artificial (Etype (gnat_entity))
&& artificial_p, debug_info_p,
- gnat_entity);
+ gnat_entity, false);
/* Save it as our equivalent in case the call below elaborates
this type again. */
save_gnu_tree (gnat_entity, gnu_tmp_decl, false);
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. */
extern tree create_type_decl (tree name, tree type, bool artificial_p,
- bool debug_info_p, Node_Id gnat_node);
+ bool debug_info_p, Node_Id gnat_node,
+ bool can_be_nameless = true);
/* Return a VAR_DECL or CONST_DECL node.
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
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);