]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Simplify check for type without stream operations
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 19 Mar 2024 10:22:40 +0000 (11:22 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 10 Jun 2024 09:03:58 +0000 (11:03 +0200)
commit025fd3eabc12a5b5ee63b607a2fa26aafb3a39b4
treea215ce1f8bde2962e5bfee517916c0a1c9488fe0
parentb849df9a981065fd119d0e4c4d0b6ec1d67bea73
ada: Simplify check for type without stream operations

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
gcc/ada/exp_ch3.adb
gcc/ada/sem_util.adb