summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_eval.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-22 13:27:35 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-22 13:27:35 +0000
commite254d7218efc3e1c06a1ca6aa66358acce0f5058 (patch)
tree4ee1820bdac7aaddef843304ab402c39277f575a /gcc/ada/sem_eval.ads
parente41b023d5af97941100cf99cfaa0e699d8356cfd (diff)
downloadgcc-e254d7218efc3e1c06a1ca6aa66358acce0f5058.tar.gz
2008-08-22 Robert Dewar <dewar@adacore.com>
* checks.adb: (In_Subrange_Of): New calling sequence (Determine_Range): Prepare for new processing using base type * exp_ch4.adb: (Compile_Time_Compare): Use new calling sequence * exp_ch5.adb: (Compile_Time_Compare): Use new calling sequence * sem_eval.adb: (Compile_Time_Compare): New calling sequence allows dealing with invalid values. (In_Subrange_Of): Ditto * sem_eval.ads: (Compile_Time_Compare): New calling sequence allows dealing with invalid values. (In_Subrange_Of): Ditto git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_eval.ads')
-rw-r--r--gcc/ada/sem_eval.ads26
1 files changed, 17 insertions, 9 deletions
diff --git a/gcc/ada/sem_eval.ads b/gcc/ada/sem_eval.ads
index ca6a5208b99..f294ed43337 100644
--- a/gcc/ada/sem_eval.ads
+++ b/gcc/ada/sem_eval.ads
@@ -133,16 +133,21 @@ package Sem_Eval is
subtype Compare_GE is Compare_Result range EQ .. GE;
subtype Compare_LE is Compare_Result range LT .. EQ;
function Compile_Time_Compare
- (L, R : Node_Id;
- Rec : Boolean := False) return Compare_Result;
+ (L, R : Node_Id;
+ Assume_Valid : Boolean;
+ Rec : Boolean := False) return Compare_Result;
-- Given two expression nodes, finds out whether it can be determined at
-- compile time how the runtime values will compare. An Unknown result
-- means that the result of a comparison cannot be determined at compile
-- time, otherwise the returned result indicates the known result of the
-- comparison, given as tightly as possible (i.e. EQ or LT is preferred
- -- returned value to LE). Rec is a parameter that is set True for a
- -- recursive call from within Compile_Time_Compare to avoid some infinite
- -- recursion cases. It should never be set by a client.
+ -- returned value to LE). If Assume_Valid is true, the result reflects
+ -- the result of assuming that entities involved in the comparison have
+ -- valid representations. If Assume_Valid is false, then the base type of
+ -- any involved entity is used so that no assumption of validity is made.
+ -- Rec is a parameter that is set True for a recursive call from within
+ -- Compile_Time_Compare to avoid some infinite recursion cases. It should
+ -- never be set by a client.
procedure Flag_Non_Static_Expr (Msg : String; Expr : Node_Id);
-- This procedure is called after it has been determined that Expr is not
@@ -357,14 +362,17 @@ package Sem_Eval is
-- and Fixed_Int are used as in routine Is_In_Range above.
function In_Subrange_Of
- (T1 : Entity_Id;
- T2 : Entity_Id;
- Fixed_Int : Boolean := False) return Boolean;
+ (T1 : Entity_Id;
+ T2 : Entity_Id;
+ Assume_Valid : Boolean;
+ Fixed_Int : Boolean := False) return Boolean;
-- Returns True if it can be guaranteed at compile time that the range of
-- values for scalar type T1 are always in the range of scalar type T2. A
-- result of False does not mean that T1 is not in T2's subrange, only that
-- it cannot be determined at compile time. Flag Fixed_Int is used as in
- -- routine Is_In_Range above.
+ -- routine Is_In_Range above. If Assume_Valid is true, the result reflects
+ -- the result of assuming that entities involved in the comparison have
+ -- valid representations.
function Is_Null_Range (Lo : Node_Id; Hi : Node_Id) return Boolean;
-- Returns True if it can guarantee that Lo .. Hi is a null range. If it