diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-07 13:55:31 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-07 13:55:31 +0000 |
commit | 9c48680582f1debbf153dc0300f7b8382b16ecf2 (patch) | |
tree | f813cf5f3512ec45d3d80589002e3c400c361b66 /gcc/ada/checks.ads | |
parent | f08c713323cbf550720ba2e3504c06c42d60017e (diff) | |
download | gcc-9c48680582f1debbf153dc0300f7b8382b16ecf2.tar.gz |
2009-04-07 Robert Dewar <dewar@adacore.com>
* checks.adb (Determine_Range): Add Assume_Valid parameter
* checks.ads (Determine_Range): Add Assume_Valid parameter
* errout.adb (Error_Msg_NEL): Use Suppress_Loop_Warnings rather than
Is_Null_Loop to suppress warnings in a loop body.
* exp_ch4.adb:
(Rewrite_Comparison): Major rewrite to accomodate invalid values
* exp_ch5.adb:
(Expand_N_Loop_Statement): Delete loop known not to execute
* opt.ads:
(Assume_No_Invalid_Values): Now set to False, and as documented, this
fully enables the proper handling of invalid values.
* sem_attr.adb:
New calling sequence for Is_In_Range
* sem_ch5.adb:
(Analyze_Iteration_Scheme): Accomodate possible invalid values
in determining if a loop range is null.
* sem_eval.adb:
(Is_In_Range): Add Assume_Valid parameter
(Is_Out_Of_Range): Add Assume_Valid_Parameter
(Compile_Time_Compare): Major rewrite to accomodate invalid values and
also to do more accurate and complete range analysis, catching more
cases.
* sem_eval.ads:
(Is_In_Range): Add Assume_Valid parameter
(Is_Out_Of_Range): Add Assume_Valid_Parameter
* sem_util.adb:
New calling sequence for Is_In_Range
* sinfo.adb:
(Suppress_Loop_Warnings): New flag
* sinfo.ads:
(Is_Null_Loop): Update documentation
(Suppress_Loop_Warnings): New flag
* gnat_ugn.texi: Document -gnatB switch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/checks.ads')
-rw-r--r-- | gcc/ada/checks.ads | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads index 4a721021823..1b88dc10201 100644 --- a/gcc/ada/checks.ads +++ b/gcc/ada/checks.ads @@ -184,10 +184,11 @@ package Checks is -- to make sure that the universal result is in range. procedure Determine_Range - (N : Node_Id; - OK : out Boolean; - Lo : out Uint; - Hi : out Uint); + (N : Node_Id; + OK : out Boolean; + Lo : out Uint; + Hi : out Uint; + Assume_Valid : Boolean := False); -- N is a node for a subexpression. If N is of a discrete type with no -- error indications, and no other peculiarities (e.g. missing type -- fields), then OK is True on return, and Lo and Hi are set to a @@ -197,7 +198,10 @@ package Checks is -- type, or some kind of error condition is detected, then OK is False on -- exit, and Lo/Hi are set to No_Uint. Thus the significance of OK being -- False on return is that no useful information is available on the range - -- of the expression. + -- of the expression. Assume_Valid determines whether the processing is + -- allowed to assume that values are in range of their subtypes. If it is + -- set to True, then this assumption is valid, if False, then processing + -- is done using base types to allow invalid values. procedure Install_Null_Excluding_Check (N : Node_Id); -- Determines whether an access node requires a runtime access check and |