diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-03-02 08:43:20 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-10 05:16:19 -0400 |
commit | 152f64c2c6c31b6574258312c867e15703add0fd (patch) | |
tree | 4ce4b5a10f0d679609e8f09851e3cbcd8c900d2c /gcc/ada/sem_util.adb | |
parent | cbe3b8d49d07cf5eee62c3963b843f3ea931b03f (diff) | |
download | gcc-152f64c2c6c31b6574258312c867e15703add0fd.zip gcc-152f64c2c6c31b6574258312c867e15703add0fd.tar.gz gcc-152f64c2c6c31b6574258312c867e15703add0fd.tar.bz2 |
[Ada] Use small limit for aggregates inside subprograms
gcc/ada/
* exp_aggr.adb (Max_Aggregate_Size): Use small limit for
aggregate inside subprograms.
* sprint.adb (Sprint_Node_Actual [N_Object_Declaration]): Do not
print the initialization expression if the No_Initialization
flag is set.
* sem_util.ads, sem_util.adb (Predicate_Enabled): New.
* exp_ch4.adb (Expand_N_Type_Conversion): Code cleanup and apply
predicate check consistently.
* exp_ch6.adb (Expand_Actuals.By_Ref_Predicate_Check): Ditto.
* sem_ch3.adb (Analyze_Object_Declaration): Ditto.
* exp_ch3.adb (Build_Assignment): Revert handling of predicate
check for allocators with qualified expressions, now handled in
Freeze_Expression directly.
* sem_aggr.adb: Fix typos.
* checks.adb: Code refactoring: use Predicate_Enabled.
(Apply_Predicate_Check): Code cleanup.
* freeze.adb (Freeze_Expression): Freeze the subtype mark before
a qualified expression on an allocator.
* exp_util.ads, exp_util.adb (Within_Internal_Subprogram):
Renamed Predicate_Check_In_Scope to clarify usage, refine
handling of predicates within init procs which should be enabled
when the node comes from source.
* sem_ch13.adb (Freeze_Entity_Checks): Update call to
Predicate_Check_In_Scope.
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index b88f6f7..6c2a499 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -24807,6 +24807,17 @@ package body Sem_Util is return Kind; end Policy_In_Effect; + ----------------------- + -- Predicate_Enabled -- + ----------------------- + + function Predicate_Enabled (Typ : Entity_Id) return Boolean is + begin + return Present (Predicate_Function (Typ)) + and then not Predicates_Ignored (Typ) + and then not Predicate_Checks_Suppressed (Empty); + end Predicate_Enabled; + ---------------------------------- -- Predicate_Tests_On_Arguments -- ---------------------------------- |