mirror of git://gcc.gnu.org/git/gcc.git
sem_ch3.adb, [...]: Minor reformatting.
2013-10-14 Robert Dewar <dewar@adacore.com> * sem_ch3.adb, sem_prag.adb, prj.ads: Minor reformatting. From-SVN: r203548
This commit is contained in:
parent
5ddcf7edb9
commit
0895ac082a
|
|
@ -1,3 +1,7 @@
|
||||||
|
2013-10-14 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
|
* sem_ch3.adb, sem_prag.adb, prj.ads: Minor reformatting.
|
||||||
|
|
||||||
2013-10-14 Hristian Kirtchev <kirtchev@adacore.com>
|
2013-10-14 Hristian Kirtchev <kirtchev@adacore.com>
|
||||||
|
|
||||||
* sem_prag.adb (Analyze_Depends_In_Decl_Part):
|
* sem_prag.adb (Analyze_Depends_In_Decl_Part):
|
||||||
|
|
|
||||||
|
|
@ -676,23 +676,23 @@ package Prj is
|
||||||
Clean_Source_Artifacts => No_Name_List);
|
Clean_Source_Artifacts => No_Name_List);
|
||||||
|
|
||||||
type Language_Data is record
|
type Language_Data is record
|
||||||
Name : Name_Id := No_Name;
|
Name : Name_Id := No_Name;
|
||||||
-- The name of the language in lower case
|
-- The name of the language in lower case
|
||||||
|
|
||||||
Display_Name : Name_Id := No_Name;
|
Display_Name : Name_Id := No_Name;
|
||||||
-- The name of the language, as found in attribute Languages
|
-- The name of the language, as found in attribute Languages
|
||||||
|
|
||||||
Config : Language_Config := No_Language_Config;
|
Config : Language_Config := No_Language_Config;
|
||||||
-- Configuration of the language
|
-- Configuration of the language
|
||||||
|
|
||||||
First_Source : Source_Id := No_Source;
|
First_Source : Source_Id := No_Source;
|
||||||
-- Head of the list of sources of the language in the project
|
-- Head of the list of sources of the language in the project
|
||||||
|
|
||||||
Mapping_Files : Mapping_Files_Htable.Instance :=
|
Mapping_Files : Mapping_Files_Htable.Instance :=
|
||||||
Mapping_Files_Htable.Nil;
|
Mapping_Files_Htable.Nil;
|
||||||
-- Hash table containing the mapping of the sources to their path names
|
-- Hash table containing the mapping of the sources to their path names
|
||||||
|
|
||||||
Next : Language_Ptr := No_Language_Index;
|
Next : Language_Ptr := No_Language_Index;
|
||||||
-- Next language of the project
|
-- Next language of the project
|
||||||
|
|
||||||
end record;
|
end record;
|
||||||
|
|
@ -1267,9 +1267,8 @@ package Prj is
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
Languages : Language_Ptr := No_Language_Index;
|
Languages : Language_Ptr := No_Language_Index;
|
||||||
-- First index of the language data in the project.
|
-- First index of the language data in the project. Traversing the list
|
||||||
-- Traversing the list gives access to all the languages supported by
|
-- gives access to all the languages supported by the project.
|
||||||
-- the project.
|
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
-- Projects --
|
-- Projects --
|
||||||
|
|
|
||||||
|
|
@ -2091,13 +2091,11 @@ package body Sem_Ch3 is
|
||||||
|
|
||||||
procedure Remove_Visible_Refinements (Spec_Id : Entity_Id) is
|
procedure Remove_Visible_Refinements (Spec_Id : Entity_Id) is
|
||||||
State_Elmt : Elmt_Id;
|
State_Elmt : Elmt_Id;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Present (Abstract_States (Spec_Id)) then
|
if Present (Abstract_States (Spec_Id)) then
|
||||||
State_Elmt := First_Elmt (Abstract_States (Spec_Id));
|
State_Elmt := First_Elmt (Abstract_States (Spec_Id));
|
||||||
while Present (State_Elmt) loop
|
while Present (State_Elmt) loop
|
||||||
Set_Has_Visible_Refinement (Node (State_Elmt), False);
|
Set_Has_Visible_Refinement (Node (State_Elmt), False);
|
||||||
|
|
||||||
Next_Elmt (State_Elmt);
|
Next_Elmt (State_Elmt);
|
||||||
end loop;
|
end loop;
|
||||||
end if;
|
end if;
|
||||||
|
|
|
||||||
|
|
@ -525,12 +525,11 @@ package body Sem_Prag is
|
||||||
Item_Id : Entity_Id;
|
Item_Id : Entity_Id;
|
||||||
Is_Input : Boolean;
|
Is_Input : Boolean;
|
||||||
Self_Ref : Boolean);
|
Self_Ref : Boolean);
|
||||||
-- Ensure that an item has a proper "in", "in out" or "out" mode
|
-- Ensure that an item has a proper IN, IN OUT, or OUT mode depending
|
||||||
-- depending on its function. If this is not the case, emit an error.
|
-- on its function. If this is not the case, emit an error. Item and
|
||||||
-- Item and Item_Id denote the attributes of an item. Flag Is_Input
|
-- Item_Id denote the attributes of an item. Flag Is_Input should be set
|
||||||
-- should be set when item comes from an input list. Flag Self_Ref
|
-- when item comes from an input list. Flag Self_Ref should be set when
|
||||||
-- should be set when the item is an output and the dependency clause
|
-- the item is an output and the dependency clause has operator "+".
|
||||||
-- has operator "+".
|
|
||||||
|
|
||||||
procedure Check_Usage
|
procedure Check_Usage
|
||||||
(Subp_Items : Elist_Id;
|
(Subp_Items : Elist_Id;
|
||||||
|
|
@ -763,9 +762,9 @@ package body Sem_Prag is
|
||||||
Add_Item (Item_Id, Seen);
|
Add_Item (Item_Id, Seen);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Detect an illegal use of an input related to a null
|
-- Detect illegal use of an input related to a null
|
||||||
-- output. Such input items cannot appear in other input
|
-- output. Such input items cannot appear in other
|
||||||
-- lists.
|
-- input lists.
|
||||||
|
|
||||||
if Is_Input
|
if Is_Input
|
||||||
and then Null_Output_Seen
|
and then Null_Output_Seen
|
||||||
|
|
@ -908,21 +907,21 @@ package body Sem_Prag is
|
||||||
|
|
||||||
if Is_Input then
|
if Is_Input then
|
||||||
|
|
||||||
-- "In" and "in out" parameters already have the proper mode to
|
-- IN and IN OUT parameters already have the proper mode to act
|
||||||
-- act as input. "Out" parameters are valid inputs only when their
|
-- as input. OUT parameters are valid inputs only when their type
|
||||||
-- type is unconstrained or tagged as their discriminants, array
|
-- is unconstrained or tagged as their discriminants, array bouns
|
||||||
-- bouns or tags can be read. In general, states and variables
|
-- or tags can be read. In general, states and variables are
|
||||||
-- are considered to have mode "in out" unless they are moded by
|
-- considered to have mode IN OUT unless they are moded by pragma
|
||||||
-- pragma [Refined_]Global. In that case, the item must appear in
|
-- [Refined_]Global. In that case, the item must appear in an
|
||||||
-- an input global list.
|
-- input global list.
|
||||||
|
|
||||||
if (Ekind (Item_Id) = E_Out_Parameter
|
if (Ekind (Item_Id) = E_Out_Parameter
|
||||||
and then not Is_Unconstrained_Or_Tagged_Item (Item_Id))
|
and then not Is_Unconstrained_Or_Tagged_Item (Item_Id))
|
||||||
or else
|
or else
|
||||||
(Global_Seen and then not Appears_In (Subp_Inputs, Item_Id))
|
(Global_Seen and then not Appears_In (Subp_Inputs, Item_Id))
|
||||||
then
|
then
|
||||||
Error_Msg_NE
|
Error_Msg_NE
|
||||||
("item & must have mode in or in out", Item, Item_Id);
|
("item & must have mode IN or `IN OUT`", Item, Item_Id);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Self-referential output
|
-- Self-referential output
|
||||||
|
|
@ -930,7 +929,7 @@ package body Sem_Prag is
|
||||||
elsif Self_Ref then
|
elsif Self_Ref then
|
||||||
|
|
||||||
-- In general, states and variables are considered to have mode
|
-- In general, states and variables are considered to have mode
|
||||||
-- "in out" unless they are explicitly moded by pragma [Refined_]
|
-- IN OUT unless they are explicitly moded by pragma [Refined_]
|
||||||
-- Global. If this is the case, then the item must appear in both
|
-- Global. If this is the case, then the item must appear in both
|
||||||
-- an input and output global list.
|
-- an input and output global list.
|
||||||
|
|
||||||
|
|
@ -941,10 +940,11 @@ package body Sem_Prag is
|
||||||
and then
|
and then
|
||||||
Appears_In (Subp_Outputs, Item_Id))
|
Appears_In (Subp_Outputs, Item_Id))
|
||||||
then
|
then
|
||||||
Error_Msg_NE ("item & must have mode in out", Item, Item_Id);
|
Error_Msg_NE
|
||||||
|
("item & must have mode `IN OUT`", Item, Item_Id);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- A self-referential out parameter of an unconstrained or tagged
|
-- A self-referential OUT parameter of an unconstrained or tagged
|
||||||
-- type acts as an input because the discriminants, array bounds
|
-- type acts as an input because the discriminants, array bounds
|
||||||
-- or the tag may be read. Note that the presence of [Refined_]
|
-- or the tag may be read. Note that the presence of [Refined_]
|
||||||
-- Global is not significant here because the item is a parameter.
|
-- Global is not significant here because the item is a parameter.
|
||||||
|
|
@ -954,27 +954,27 @@ package body Sem_Prag is
|
||||||
then
|
then
|
||||||
null;
|
null;
|
||||||
|
|
||||||
-- The remaining cases are "in", "in out" and "out" parameters. To
|
-- The remaining cases are IN, IN OUT, and OUT parameters. To
|
||||||
-- qualify as self-referential item, the parameter must be of mode
|
-- qualify as self-referential item, the parameter must be of
|
||||||
-- "in out".
|
-- mode IN OUT.
|
||||||
|
|
||||||
elsif Ekind (Item_Id) /= E_In_Out_Parameter then
|
elsif Ekind (Item_Id) /= E_In_Out_Parameter then
|
||||||
Error_Msg_NE ("item & must have mode in out", Item, Item_Id);
|
Error_Msg_NE ("item & must have mode `IN OUT`", Item, Item_Id);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Output
|
-- Output
|
||||||
|
|
||||||
-- "In out" and "ou" parameters already have the proper mode to act
|
-- IN OUT and OUT parameters already have the proper mode to act as
|
||||||
-- as output. In general, states and variables are considered to have
|
-- output. In general, states and variables are considered to have
|
||||||
-- mode "in out" unless they are moded by pragma [Refined_]Global.
|
-- mode IN OUT unless they are moded by pragma [Refined_]Global. In
|
||||||
-- In that case, the item must appear in an output global list.
|
-- that case, the item must appear in an output global list.
|
||||||
|
|
||||||
elsif Ekind (Item_Id) = E_In_Parameter
|
elsif Ekind (Item_Id) = E_In_Parameter
|
||||||
or else
|
or else
|
||||||
(Global_Seen and then not Appears_In (Subp_Outputs, Item_Id))
|
(Global_Seen and then not Appears_In (Subp_Outputs, Item_Id))
|
||||||
then
|
then
|
||||||
Error_Msg_NE
|
Error_Msg_NE
|
||||||
("item & must have mode out or in out", Item, Item_Id);
|
("item & must have mode OUT or `IN OUT`", Item, Item_Id);
|
||||||
end if;
|
end if;
|
||||||
end Check_Mode;
|
end Check_Mode;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue