diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-01-11 00:23:21 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-09 09:27:32 +0000 |
commit | 93e7c91eb7744b832df14a7afca45906ed3c580f (patch) | |
tree | 5a8d047f48df05256b0bcdef05f5bac74c41c76f /gcc/ada/exp_prag.adb | |
parent | 2fe776e2d346bcf450f40739825249cab449e567 (diff) | |
download | gcc-93e7c91eb7744b832df14a7afca45906ed3c580f.zip gcc-93e7c91eb7744b832df14a7afca45906ed3c580f.tar.gz gcc-93e7c91eb7744b832df14a7afca45906ed3c580f.tar.bz2 |
[Ada] Allow Big_Integer in loop and subprogram variants
In SPARK loop and subprogram variants we now allow expressions of any
discrete type and of Ada.Numerics.Big_Numbers.Big_Integers.Big_Integer
type.
gcc/ada/
* exp_prag.adb (Expand_Pragma_Loop_Variant,
Expand_Pragma_Subprogram_Variant): Adapt call via
Process_Variant to Make_Variant_Comparison.
* exp_util.adb (Make_Variant_Comparison): Compare Big_Integer
expressions with a function call and not an operator.
* exp_util.ads (Make_Variant_Comparison): Add type parameter,
which is needed because the Curr_Val and Old_Val expressions
might not be yet decorated.
* rtsfind.ads: (RTU_Id): Add support for Big_Integers and
Big_Integers_Ghost.
(RE_Id): Add support for Big_Integer and its ghost variant.
(RE_Unit_Table): Add mapping from Big_Integer to Big_Integers;
same for the ghost variants.
* rtsfind.adb (Get_Unit_Name): Add support for Big_Numbers.
* sem_prag.adb (Analyze_Pragma): Allow Big_Integer in pragma
Loop_Variant.
(Analyze_Variant): Allow Big_Integer in pragma
Subprogram_Variant.
Diffstat (limited to 'gcc/ada/exp_prag.adb')
-rw-r--r-- | gcc/ada/exp_prag.adb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index f434823..35ec250 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -2636,6 +2636,7 @@ package body Exp_Prag is Expression => Make_Variant_Comparison (Loc, Mode => Chars (Variant), + Typ => Expr_Typ, Curr_Val => New_Occurrence_Of (Curr_Id, Loc), Old_Val => New_Occurrence_Of (Old_Id, Loc))))); @@ -3000,6 +3001,7 @@ package body Exp_Prag is Expression => Make_Variant_Comparison (Loc, Mode => Chars (First (Choices (Variant))), + Typ => Expr_Typ, Curr_Val => New_Occurrence_Of (Curr_Id, Loc), Old_Val => New_Occurrence_Of (Old_Id, Loc))))); |