Recursive routine Type_Without_Stream_Operation was checking restriction
No_Default_Stream_Attributes at every call, which was confusing and
inefficient.
This routine is only called from the places: Check_Stream_Attribute,
which already checks if this restriction is active, and
Stream_Operation_OK, where we add such a check.
Cleanup related to extending the use of No_Streams restriction.
gcc/ada/
* exp_ch3.adb (Stream_Operation_OK): Check restriction
No_Default_Stream_Attributes before call to
Type_Without_Stream_Operation.
* sem_util.adb (Type_Without_Stream_Operation): Remove static
condition from recursive routine
and then No (No_Tagged_Streams_Pragma (Typ))
and then not No_Run_Time_Mode
and then RTE_Available (RE_Tag)
- and then No (Type_Without_Stream_Operation (Typ))
+ and then
+ (not Restriction_Active (No_Default_Stream_Attributes)
+ or else No (Type_Without_Stream_Operation (Typ)))
and then RTE_Available (RE_Root_Stream_Type);
end Stream_Operation_OK;
Op_Missing : Boolean;
begin
- if not Restriction_Active (No_Default_Stream_Attributes) then
- return Empty;
- end if;
-
if Is_Elementary_Type (T) then
if Op = TSS_Null then
Op_Missing :=