summaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-01 10:04:40 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-01 10:04:40 +0000
commit314a23b6eb1ed66ddce188a8e105c8050b99b87e (patch)
treeb338d3df4e73cbb9b9be4f8a5366b15275287114 /gcc/ada/checks.adb
parentac7a21466424c6756e6670dd1943d67497962ac1 (diff)
downloadgcc-314a23b6eb1ed66ddce188a8e105c8050b99b87e.tar.gz
2004-04-01 Robert Dewar <dewar@gnat.com>
* checks.adb: Minor reformatting throughout Note that prev checkin added RM reference to alignment warning 2004-04-01 Ed Schonberg <schonberg@gnat.com> * exp_aggr.adb (Get_Component_Val): Treat a string literal as non-static when building aggregate for bit-packed array. * exp_ch4.adb (Expand_N_Slice): If a packed slice is an actual of a function call that is itself the actual in a procedure call, build temporary for it. * exp_pakd.adb (Expand_Bit_Packed_Element_Set): If right-hand side is a string literal, create a temporary for it, constant folding only handles scalars here. 2004-04-01 Vincent Celier <celier@gnat.com> * ali-util.adb (Post_Scan, Error_Msg, Error_Msg_S, Error_Msg_SC, Error_Msg_SP): New empty procedures to instantiate the Scanner. (Style, Scanner): Instantiations of Styleg and Scng to be able to scan tokens. (Accumulate_Checksum, Initialize_Checksum): Remove procedures. (Get_File_Checksum): Use the instantiated scanner to scan all the tokens and get the checksum. * make.adb (Gnatmake): Do not insert into Q the Main_Source if it is already in the Q. Increase the Marking_Label at the end of the Multiple_Main_Loop, instead of at the beginning. * osint.adb (Lib_File_Name): Use Multi_Unit_Index_Character, not '~' directly. (Osint package elaboration): Change Multi_Unit_Index_Character to '$' if on VMS. * osint.ads (Multi_Unit_Index_Character): New Character global variable * osint-c.adb (Set_Library_Info_Name): Use Multi_Unit_Index_Character, not '~' directly. * par.adb: Remove test on file name to detect language defined units. Add test on unit name, after parsing, to detect language defined units that are not compiled with -gnatg (except System.RPC and its children) * par-ch10.adb (P_Compilation_Unit): In multi-unit sources, scan the following units without style checking. * switch-c.adb: Change -gnatC to -gnateI * usage.adb: Document new switch -gnateInnn * scng.adb (Accumulate_Token_Checksum): New procedure (Scan): Call Accumulate_Token_Checksum after each identifier, reserved word or literal number. (Scan.Nlit.Scan_Integer): Do not accumulate internal '_' in litteral numbers. 2004-04-01 Thomas Quinot <quinot@act-europe.fr> * a-tasatt.adb, g-comlin.adb, sinput-c.adb, s-secsta.adb, s-tpobop.adb, switch-m.adb, 56taprop.adb, 5ginterr.adb, 5gmastop.adb, 5staprop.adb, 5vinterr.adb, 5vtaprop.adb, 5vtpopde.adb, 5vtpopde.adb: Add missing 'constant' keywords. 2004-04-01 Javier Miranda <miranda@gnat.com> * par-ch4.adb: (P_Allocator): Code cleanup * sem_ch3.adb (Access_Definition): Properly set the null-excluding attribute. * sinfo.ads: Complete documentation of previous change 2004-04-01 GNAT Script <nobody@gnat.com> * Make-lang.in: Makefile automatically updated 2004-04-01 Pascal Obry <obry@gnat.com> * gnatlink.adb (Process_Binder_File): Remove duplicate linker options only on VMS. This special handling was done because an old GNU/ld bug on Windows which has been fixed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb78
1 files changed, 26 insertions, 52 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index b16fcc18c2f..ea73f2f8d4f 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -238,8 +238,7 @@ package body Checks is
function Guard_Access
(Cond : Node_Id;
Loc : Source_Ptr;
- Ck_Node : Node_Id)
- return Node_Id;
+ Ck_Node : Node_Id) return Node_Id;
-- In the access type case, guard the test with a test to ensure
-- that the access value is non-null, since the checks do not
-- not apply to null access values.
@@ -256,8 +255,7 @@ package body Checks is
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
- Warn_Node : Node_Id)
- return Check_Result;
+ Warn_Node : Node_Id) return Check_Result;
-- Like Apply_Selected_Length_Checks, except it doesn't modify
-- anything, just returns a list of nodes as described in the spec of
-- this package for the Range_Check function.
@@ -266,8 +264,7 @@ package body Checks is
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
- Warn_Node : Node_Id)
- return Check_Result;
+ Warn_Node : Node_Id) return Check_Result;
-- Like Apply_Selected_Range_Checks, except it doesn't modify anything,
-- just returns a list of nodes as described in the spec of this package
-- for the Range_Check function.
@@ -2098,8 +2095,7 @@ package body Checks is
function Build_Discriminant_Checks
(N : Node_Id;
- T_Typ : Entity_Id)
- return Node_Id
+ T_Typ : Entity_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Cond : Node_Id;
@@ -3487,8 +3483,7 @@ package body Checks is
is
function Within_Range_Of
(Target_Type : Entity_Id;
- Check_Type : Entity_Id)
- return Boolean;
+ Check_Type : Entity_Id) return Boolean;
-- Given a requirement for checking a range against Target_Type, and
-- and a range Check_Type against which a check has already been made,
-- determines if the check against check type is sufficient to ensure
@@ -3500,8 +3495,7 @@ package body Checks is
function Within_Range_Of
(Target_Type : Entity_Id;
- Check_Type : Entity_Id)
- return Boolean
+ Check_Type : Entity_Id) return Boolean
is
begin
if Target_Type = Check_Type then
@@ -4191,8 +4185,7 @@ package body Checks is
function Guard_Access
(Cond : Node_Id;
Loc : Source_Ptr;
- Ck_Node : Node_Id)
- return Node_Id
+ Ck_Node : Node_Id) return Node_Id
is
begin
if Nkind (Cond) = N_Or_Else then
@@ -4480,8 +4473,7 @@ package body Checks is
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
- Warn_Node : Node_Id := Empty)
- return Check_Result
+ Warn_Node : Node_Id := Empty) return Check_Result
is
begin
return Selected_Range_Checks
@@ -4607,8 +4599,7 @@ package body Checks is
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
- Warn_Node : Node_Id)
- return Check_Result
+ Warn_Node : Node_Id) return Check_Result
is
Loc : constant Source_Ptr := Sloc (Ck_Node);
S_Typ : Entity_Id;
@@ -4626,6 +4617,7 @@ package body Checks is
function Get_E_Length (E : Entity_Id; Indx : Nat) return Node_Id;
function Get_N_Length (N : Node_Id; Indx : Nat) return Node_Id;
+ -- Comments required ???
function Same_Bounds (L : Node_Id; R : Node_Id) return Boolean;
-- True for equal literals and for nodes that denote the same constant
@@ -4636,16 +4628,14 @@ package body Checks is
function Length_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id;
+ Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Typ'Length /= Exptyp'Length
function Length_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id;
+ Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Typ'Length /= Expr'Length
@@ -4812,8 +4802,7 @@ package body Checks is
function Length_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id
+ Indx : Nat) return Node_Id
is
begin
return
@@ -4830,8 +4819,7 @@ package body Checks is
function Length_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id
+ Indx : Nat) return Node_Id
is
begin
return
@@ -5113,8 +5101,7 @@ package body Checks is
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
- Warn_Node : Node_Id)
- return Check_Result
+ Warn_Node : Node_Id) return Check_Result
is
Loc : constant Source_Ptr := Sloc (Ck_Node);
S_Typ : Entity_Id;
@@ -5132,8 +5119,7 @@ package body Checks is
function Discrete_Range_Cond
(Expr : Node_Id;
- Typ : Entity_Id)
- return Node_Id;
+ Typ : Entity_Id) return Node_Id;
-- Returns expression to compute:
-- Low_Bound (Expr) < Typ'First
-- or else
@@ -5141,8 +5127,7 @@ package body Checks is
function Discrete_Expr_Cond
(Expr : Node_Id;
- Typ : Entity_Id)
- return Node_Id;
+ Typ : Entity_Id) return Node_Id;
-- Returns expression to compute:
-- Expr < Typ'First
-- or else
@@ -5151,8 +5136,7 @@ package body Checks is
function Get_E_First_Or_Last
(E : Entity_Id;
Indx : Nat;
- Nam : Name_Id)
- return Node_Id;
+ Nam : Name_Id) return Node_Id;
-- Returns expression to compute:
-- E'First or E'Last
@@ -5172,16 +5156,14 @@ package body Checks is
function Range_Equal_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id;
+ Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Exptyp'First /= Typ'First or else Exptyp'Last /= Typ'Last
function Range_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id;
+ Indx : Nat) return Node_Id;
-- Return expression to compute:
-- Expr'First < Typ'First or else Expr'Last > Typ'Last
@@ -5211,8 +5193,7 @@ package body Checks is
function Discrete_Expr_Cond
(Expr : Node_Id;
- Typ : Entity_Id)
- return Node_Id
+ Typ : Entity_Id) return Node_Id
is
begin
return
@@ -5243,8 +5224,7 @@ package body Checks is
function Discrete_Range_Cond
(Expr : Node_Id;
- Typ : Entity_Id)
- return Node_Id
+ Typ : Entity_Id) return Node_Id
is
LB : Node_Id := Low_Bound (Expr);
HB : Node_Id := High_Bound (Expr);
@@ -5318,8 +5298,7 @@ package body Checks is
function Get_E_First_Or_Last
(E : Entity_Id;
Indx : Nat;
- Nam : Name_Id)
- return Node_Id
+ Nam : Name_Id) return Node_Id
is
N : Node_Id;
LB : Node_Id;
@@ -5432,7 +5411,6 @@ package body Checks is
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
-
end Get_N_First;
----------------
@@ -5448,7 +5426,6 @@ package body Checks is
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
-
end Get_N_Last;
------------------
@@ -5458,8 +5435,7 @@ package body Checks is
function Range_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id
+ Indx : Nat) return Node_Id
is
begin
return
@@ -5483,8 +5459,7 @@ package body Checks is
function Range_Equal_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id
+ Indx : Nat) return Node_Id
is
begin
return
@@ -5506,8 +5481,7 @@ package body Checks is
function Range_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
- Indx : Nat)
- return Node_Id
+ Indx : Nat) return Node_Id
is
begin
return