Commit 3428cb9f by Arnaud Charlet

[multiple changes]

2010-06-17  Robert Dewar  <dewar@adacore.com>

	* switch-c.ads, switch-c.adb, sem_ch13.adb: Minor reformatting.
	* sem_ch12.adb: Add pragmas Assert and Check to previous change.

2010-06-17  Gary Dismukes  <dismukes@adacore.com>

	* layout.adb (Layout_Type): Broaden test for setting an array type's
	Component_Size to include all scalar types, not just discrete types
	(components of real types were missed).
	* sem_ch3.adb (Constrain_Index): Add missing setting of First_Literal
	on the itype created for an index (consistent with Make_Index and
	avoids possible Assert_Failures).

2010-06-17  Robert Dewar  <dewar@adacore.com>

	* atree.ads, atree.adb: Add 6-parameter version of Ekind_In
	* einfo.adb: Minor code reformatting (use Ekind_In)

From-SVN: r160887
parent 547c5954
2010-06-17 Robert Dewar <dewar@adacore.com>
* switch-c.ads, switch-c.adb, sem_ch13.adb: Minor reformatting.
* sem_ch12.adb: Add pragmas Assert and Check to previous change.
2010-06-17 Gary Dismukes <dismukes@adacore.com>
* layout.adb (Layout_Type): Broaden test for setting an array type's
Component_Size to include all scalar types, not just discrete types
(components of real types were missed).
* sem_ch3.adb (Constrain_Index): Add missing setting of First_Literal
on the itype created for an index (consistent with Make_Index and
avoids possible Assert_Failures).
2010-06-17 Robert Dewar <dewar@adacore.com>
* atree.ads, atree.adb: Add 6-parameter version of Ekind_In
* einfo.adb: Minor code reformatting (use Ekind_In)
2010-06-17 Robert Dewar <dewar@adacore.com>
* sem_warn.adb (Test_Ref): Abandon scan if access subprogram parameter
found.
......
......@@ -823,6 +823,24 @@ package body Atree is
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5 or else
T = V6;
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind) return Boolean
......@@ -864,6 +882,19 @@ package body Atree is
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6);
end Ekind_In;
------------------
-- Error_Posted --
------------------
......
......@@ -657,6 +657,15 @@ package Atree is
V5 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind) return Boolean;
......@@ -682,6 +691,15 @@ package Atree is
V4 : Entity_Kind;
V5 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean;
pragma Inline (Ekind_In);
-- Inline all above functions
......
......@@ -2560,10 +2560,10 @@ package body Layout is
begin
-- For some reasons, access types can cause trouble, So let's
-- just do this for discrete types ???
-- just do this for scalar types ???
if Present (CT)
and then Is_Discrete_Type (CT)
and then Is_Scalar_Type (CT)
and then Known_Static_Esize (CT)
then
declare
......
......@@ -12223,7 +12223,6 @@ package body Sem_Ch12 is
-- All other cases than aggregates
else
-- For pragmas, we propagate the Enabled status for the
-- relevant pragmas to the original generic tree. This was
-- originally needed for SCO generation. It is no longer
......@@ -12233,8 +12232,10 @@ package body Sem_Ch12 is
if Nkind (N) = N_Pragma
and then
(Pragma_Name (N) = Name_Precondition
or else Pragma_Name (N) = Name_Postcondition)
(Pragma_Name (N) = Name_Assert
or else Pragma_Name (N) = Name_Check
or else Pragma_Name (N) = Name_Precondition
or else Pragma_Name (N) = Name_Postcondition)
and then Present (Associated_Node (Pragma_Identifier (N)))
then
Set_Pragma_Enabled (N,
......
......@@ -2370,7 +2370,6 @@ package body Sem_Ch13 is
-- Get the alignment value to perform error checking
Mod_Val := Get_Alignment_Value (Expression (M));
end if;
end;
end if;
......
......@@ -11071,6 +11071,7 @@ package body Sem_Ch3 is
else
Set_Ekind (Def_Id, E_Enumeration_Subtype);
Set_Is_Character_Type (Def_Id, Is_Character_Type (T));
Set_First_Literal (Def_Id, First_Literal (T));
end if;
Set_Size_Info (Def_Id, (T));
......
......@@ -23,8 +23,6 @@
-- --
------------------------------------------------------------------------------
with Ada.Command_Line; use Ada.Command_Line;
with Debug; use Debug;
with Lib; use Lib;
with Osint; use Osint;
......@@ -34,8 +32,9 @@ with Validsw; use Validsw;
with Sem_Warn; use Sem_Warn;
with Stylesw; use Stylesw;
with System.OS_Lib; use System.OS_Lib;
with Ada.Command_Line; use Ada.Command_Line;
with System.OS_Lib; use System.OS_Lib;
with System.WCh_Con; use System.WCh_Con;
package body Switch.C is
......@@ -45,8 +44,7 @@ package body Switch.C is
function Switch_Subsequently_Cancelled
(C : String;
Arg_Rank : Positive)
return Boolean;
Arg_Rank : Positive) return Boolean;
-- This function is called from Scan_Front_End_Switches. It determines if
-- the switch currently being scanned is followed by a switch of the form
-- "-gnat-" & C, where C is the argument. If so, then True is returned,
......@@ -1098,12 +1096,14 @@ package body Switch.C is
function Switch_Subsequently_Cancelled
(C : String;
Arg_Rank : Positive)
return Boolean
Arg_Rank : Positive) return Boolean
is
Arg : Positive;
Max : constant Natural := Argument_Count;
begin
-- Loop through arguments following the current one
Arg := Arg_Rank + 1;
while Arg < Max loop
declare
......@@ -1117,6 +1117,8 @@ package body Switch.C is
Arg := Arg + 1;
end loop;
-- No match found, not cancelled
return False;
end Switch_Subsequently_Cancelled;
......
......@@ -41,6 +41,7 @@ package Switch.C is
-- an optional terminating NUL character is allowed. A bad switch causes
-- a fatal error exit and control does not return. The call also sets
-- Usage_Requested to True if a switch -gnath is encountered.
--
-- Arg_Rank is the position of the switch in the command line arguments.
-- It is used for certain switches -gnatx to check if a subsequent switch
-- -gnat-x cancels the switch -gnatx.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment