@@ -2908,12 +2908,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
2908
2908
{
2909
2909
Node_Id full_definition = Declaration_Node (gnat_entity );
2910
2910
Node_Id record_definition = Type_Definition (full_definition );
2911
- Node_Id gnat_constr ;
2912
2911
Entity_Id gnat_field ;
2913
- tree gnu_field , gnu_field_list = NULL_TREE ;
2914
- tree gnu_get_parent ;
2912
+ tree gnu_field , gnu_field_list = NULL_TREE , gnu_get_parent ;
2915
2913
/* Set PACKED in keeping with gnat_to_gnu_field. */
2916
- const int packed
2914
+ int packed
2917
2915
= Is_Packed (gnat_entity )
2918
2916
? 1
2919
2917
: Component_Alignment (gnat_entity ) == Calign_Storage_Unit
@@ -2923,13 +2921,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
2923
2921
&& Known_RM_Size (gnat_entity )))
2924
2922
? -2
2925
2923
: 0 ;
2926
- const bool has_discr = Has_Discriminants (gnat_entity );
2927
- const bool has_rep = Has_Specified_Layout (gnat_entity );
2928
- const bool is_extension
2924
+ bool has_discr = Has_Discriminants (gnat_entity );
2925
+ bool has_rep = Has_Specified_Layout (gnat_entity );
2926
+ bool all_rep = has_rep ;
2927
+ bool is_extension
2929
2928
= (Is_Tagged_Type (gnat_entity )
2930
2929
&& Nkind (record_definition ) == N_Derived_Type_Definition );
2931
- const bool is_unchecked_union = Is_Unchecked_Union (gnat_entity );
2932
- bool all_rep = has_rep ;
2930
+ bool is_unchecked_union = Is_Unchecked_Union (gnat_entity );
2933
2931
2934
2932
/* See if all fields have a rep clause. Stop when we find one
2935
2933
that doesn't. */
@@ -3168,51 +3166,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
3168
3166
}
3169
3167
}
3170
3168
3171
- /* If we have a derived untagged type that renames discriminants in
3172
- the root type, the (stored) discriminants are a just copy of the
3173
- discriminants of the root type. This means that any constraints
3174
- added by the renaming in the derivation are disregarded as far
3175
- as the layout of the derived type is concerned. To rescue them,
3176
- we change the type of the (stored) discriminants to a subtype
3177
- with the bounds of the type of the visible discriminants. */
3178
- if (has_discr
3179
- && !is_extension
3180
- && Stored_Constraint (gnat_entity ) != No_Elist )
3181
- for (gnat_constr = First_Elmt (Stored_Constraint (gnat_entity ));
3182
- gnat_constr != No_Elmt ;
3183
- gnat_constr = Next_Elmt (gnat_constr ))
3184
- if (Nkind (Node (gnat_constr )) == N_Identifier
3185
- /* Ignore access discriminants. */
3186
- && !Is_Access_Type (Etype (Node (gnat_constr )))
3187
- && Ekind (Entity (Node (gnat_constr ))) == E_Discriminant )
3188
- {
3189
- Entity_Id gnat_discr = Entity (Node (gnat_constr ));
3190
- tree gnu_discr_type = gnat_to_gnu_type (Etype (gnat_discr ));
3191
- tree gnu_ref
3192
- = gnat_to_gnu_entity (Original_Record_Component (gnat_discr ),
3193
- NULL_TREE , 0 );
3194
-
3195
- /* GNU_REF must be an expression using a PLACEHOLDER_EXPR built
3196
- just above for one of the stored discriminants. */
3197
- gcc_assert (TREE_TYPE (TREE_OPERAND (gnu_ref , 0 )) == gnu_type );
3198
-
3199
- if (gnu_discr_type != TREE_TYPE (gnu_ref ))
3200
- {
3201
- const unsigned prec = TYPE_PRECISION (TREE_TYPE (gnu_ref ));
3202
- tree gnu_subtype
3203
- = TYPE_UNSIGNED (TREE_TYPE (gnu_ref ))
3204
- ? make_unsigned_type (prec ) : make_signed_type (prec );
3205
- TREE_TYPE (gnu_subtype ) = TREE_TYPE (gnu_ref );
3206
- TYPE_EXTRA_SUBTYPE_P (gnu_subtype ) = 1 ;
3207
- SET_TYPE_RM_MIN_VALUE (gnu_subtype ,
3208
- TYPE_MIN_VALUE (gnu_discr_type ));
3209
- SET_TYPE_RM_MAX_VALUE (gnu_subtype ,
3210
- TYPE_MAX_VALUE (gnu_discr_type ));
3211
- TREE_TYPE (gnu_ref )
3212
- = TREE_TYPE (TREE_OPERAND (gnu_ref , 1 )) = gnu_subtype ;
3213
- }
3214
- }
3215
-
3216
3169
/* Add the fields into the record type and finish it up. */
3217
3170
components_to_record (gnu_type , Component_List (record_definition ),
3218
3171
gnu_field_list , packed , definition , false,
@@ -4125,10 +4078,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
4125
4078
tree gnu_stub_type = NULL_TREE , gnu_stub_name = NULL_TREE ;
4126
4079
tree gnu_ext_name = create_concat_name (gnat_entity , NULL );
4127
4080
Entity_Id gnat_param ;
4128
- enum inline_status_t inline_status
4129
- = Has_Pragma_No_Inline (gnat_entity )
4130
- ? is_suppressed
4131
- : (Is_Inlined (gnat_entity ) ? is_enabled : is_disabled );
4081
+ bool inline_flag = Is_Inlined (gnat_entity );
4132
4082
bool public_flag = Is_Public (gnat_entity ) || imported_p ;
4133
4083
bool extern_flag
4134
4084
= (Is_Public (gnat_entity ) && !definition ) || imported_p ;
@@ -4684,15 +4634,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
4684
4634
4685
4635
gnu_decl
4686
4636
= create_subprog_decl (gnu_entity_name , gnu_ext_name , gnu_type ,
4687
- gnu_param_list , inline_status ,
4688
- public_flag , extern_flag , artificial_flag ,
4689
- attr_list , gnat_entity );
4637
+ gnu_param_list , inline_flag , public_flag ,
4638
+ extern_flag , artificial_flag , attr_list ,
4639
+ gnat_entity );
4690
4640
if (has_stub )
4691
4641
{
4692
4642
tree gnu_stub_decl
4693
4643
= create_subprog_decl (gnu_entity_name , gnu_stub_name ,
4694
4644
gnu_stub_type , gnu_stub_param_list ,
4695
- inline_status , true, extern_flag ,
4645
+ inline_flag , true, extern_flag ,
4696
4646
false, attr_list , gnat_entity );
4697
4647
SET_DECL_FUNCTION_STUB (gnu_decl , gnu_stub_decl );
4698
4648
}
@@ -5425,7 +5375,7 @@ get_minimal_subprog_decl (Entity_Id gnat_entity)
5425
5375
5426
5376
return
5427
5377
create_subprog_decl (gnu_entity_name , gnu_ext_name , void_ftype , NULL_TREE ,
5428
- is_disabled , true, true, true, attr_list , gnat_entity );
5378
+ false , true, true, true, attr_list , gnat_entity );
5429
5379
}
5430
5380
5431
5381
/* Return whether the E_Subprogram_Type/E_Function/E_Procedure GNAT_ENTITY is
@@ -6014,7 +5964,7 @@ elaborate_entity (Entity_Id gnat_entity)
6014
5964
Present (gnat_field );
6015
5965
gnat_field = Next_Discriminant (gnat_field ),
6016
5966
gnat_discriminant_expr = Next_Elmt (gnat_discriminant_expr ))
6017
- /* Ignore access discriminants. */
5967
+ /* ??? For now, ignore access discriminants. */
6018
5968
if (!Is_Access_Type (Etype (Node (gnat_discriminant_expr ))))
6019
5969
elaborate_expression (Node (gnat_discriminant_expr ),
6020
5970
gnat_entity , get_entity_name (gnat_field ),
@@ -7660,20 +7610,20 @@ build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition)
7660
7610
{
7661
7611
vec < subst_pair > gnu_list = vNULL ;
7662
7612
Entity_Id gnat_discrim ;
7663
- Node_Id gnat_constr ;
7613
+ Node_Id gnat_value ;
7664
7614
7665
7615
for (gnat_discrim = First_Stored_Discriminant (gnat_type ),
7666
- gnat_constr = First_Elmt (Stored_Constraint (gnat_subtype ));
7616
+ gnat_value = First_Elmt (Stored_Constraint (gnat_subtype ));
7667
7617
Present (gnat_discrim );
7668
7618
gnat_discrim = Next_Stored_Discriminant (gnat_discrim ),
7669
- gnat_constr = Next_Elmt (gnat_constr ))
7619
+ gnat_value = Next_Elmt (gnat_value ))
7670
7620
/* Ignore access discriminants. */
7671
- if (!Is_Access_Type (Etype (Node (gnat_constr ))))
7621
+ if (!Is_Access_Type (Etype (Node (gnat_value ))))
7672
7622
{
7673
7623
tree gnu_field = gnat_to_gnu_field_decl (gnat_discrim );
7674
7624
tree replacement = convert (TREE_TYPE (gnu_field ),
7675
7625
elaborate_expression
7676
- (Node (gnat_constr ), gnat_subtype ,
7626
+ (Node (gnat_value ), gnat_subtype ,
7677
7627
get_entity_name (gnat_discrim ),
7678
7628
definition , true, false));
7679
7629
subst_pair s = {gnu_field , replacement };
0 commit comments