diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-19 12:46:14 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-19 12:46:14 +0100 |
commit | c63a2ad68bc0704fc2926badc46f3ccd952dbbb9 (patch) | |
tree | 9b5192623bf3246439db9c7ea3d6c832eca97899 /gcc/ada/sem_util.adb | |
parent | 40bf00b1f85afad60951ed3c07b5ffd6414241cf (diff) | |
download | gcc-c63a2ad68bc0704fc2926badc46f3ccd952dbbb9.zip gcc-c63a2ad68bc0704fc2926badc46f3ccd952dbbb9.tar.gz gcc-c63a2ad68bc0704fc2926badc46f3ccd952dbbb9.tar.bz2 |
[multiple changes]
2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
* lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
2017-01-19 Bob Duff <duff@adacore.com>
* bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
Increment Warnings_Detected. It was decrementing, which is
wrong since we just issued a warning message.
* binderr.ads (Errors_Detected, Warnings_Detected): Declare
these variables to be of subtype Nat instead of Int, because
they should never be negative.
2017-01-19 Javier Miranda <miranda@adacore.com>
* contracts.adb (Build_Postconditions_Procedure): Replace
Generate_C_Code by Modify_Tree_For_C.
* exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
Replace Generate_C_Code by Modify_Tree_For_C.
* exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
Modify_Tree_For_C.
* exp_ch11.adb (Expand_N_Exception_Declaration): Replace
Generate_C_Code by Modify_Tree_For_C.
* exp_ch4.adb (Expand_Allocator_Expression): Replace
Generate_C_Code by Modify_Tree_For_C.
* exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
by Modify_Tree_For_C.
* exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
Generate_C_Code by Modify_Tree_For_C.
* sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
by Modify_Tree_For_C.
* sinfo.ads (Modify_Tree_For_C): Adding documentation.
From-SVN: r244619
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index f83d9ee..352673c 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -8068,13 +8068,11 @@ package body Sem_Util is ---------------------- procedure Get_Index_Bounds - (N : Node_Id; - L, H : out Node_Id; + (N : Node_Id; + L : out Node_Id; + H : out Node_Id; Use_Full_View : Boolean := False) is - Kind : constant Node_Kind := Nkind (N); - R : Node_Id; - function Scalar_Range_Of_Right_View return Node_Id; -- Call Scalar_Range with argument determined by Use_Full_View -- parameter. @@ -8085,22 +8083,31 @@ package body Sem_Util is function Scalar_Range_Of_Right_View return Node_Id is E : Entity_Id := Entity (N); + begin if Use_Full_View and then Present (Full_View (E)) then E := Full_View (E); end if; + return Scalar_Range (E); end Scalar_Range_Of_Right_View; + -- Local variables + + Kind : constant Node_Kind := Nkind (N); + Rng : Node_Id; + + -- Start of processing for Get_Index_Bounds + begin if Kind = N_Range then L := Low_Bound (N); H := High_Bound (N); elsif Kind = N_Subtype_Indication then - R := Range_Expression (Constraint (N)); + Rng := Range_Expression (Constraint (N)); - if R = Error then + if Rng = Error then L := Error; H := Error; return; |