Commit db761fee by Arnaud Charlet

[multiple changes]

2015-01-06  Robert Dewar  <dewar@adacore.com>

	* namet.ads: Document use of Boolean2 for No_Use_Of_Entity.
	* restrict.ads (No_Use_Of_Entity): New table.
	* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
	Ignore No_Use_Of_Entity (will be processed in parser).
	* snames.ads-tmpl: Add entry for Name_No_Use_Of_Entity.

2015-01-06  Vincent Celier  <celier@adacore.com>

	* prj-tree.adb (Imported_Or_Extended_Project_Of): Do not try
	to check for an extended project, if a project does not have
	yet a project declaration.

From-SVN: r219235
parent 0566484a
2015-01-06 Robert Dewar <dewar@adacore.com>
* namet.ads: Document use of Boolean2 for No_Use_Of_Entity.
* restrict.ads (No_Use_Of_Entity): New table.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Ignore No_Use_Of_Entity (will be processed in parser).
* snames.ads-tmpl: Add entry for Name_No_Use_Of_Entity.
2015-01-06 Vincent Celier <celier@adacore.com>
* prj-tree.adb (Imported_Or_Extended_Project_Of): Do not try
to check for an extended project, if a project does not have
yet a project declaration.
2015-01-06 Pierre-Marie Derodat <derodat@adacore.com>
* scos.ads: Update documentation about the SCO table build
......
......@@ -131,7 +131,11 @@ package Namet is
-- The Boolean1 field is used to mark address clauses to optimize the
-- performance of the Exp_Util.Following_Address_Clause function.
-- The Boolean2/Boolean3 fields are not used
-- The Boolean2 field is used to mark simple names that appear in
-- Restriction[_Warning]s pragmas for No_Use_Of_Entity. This avoids most
-- unnecessary searches of the No_Use_Of_Entity table.
-- The Boolean3 field is not used
-- In the binder, we have the following uses:
......
......@@ -1151,6 +1151,7 @@ package body Prj.Tree is
is
With_Clause : Project_Node_Id;
Result : Project_Node_Id := Empty_Node;
Decl : Project_Node_Id;
begin
-- First check all the imported projects
......@@ -1167,9 +1168,14 @@ package body Prj.Tree is
return Result;
end if;
Result :=
Extended_Project_Of
(Project_Declaration_Of (Result, In_Tree), In_Tree);
Decl := Project_Declaration_Of (Result, In_Tree);
-- Do not try to check for an extended project, if the project
-- does not have yet a project declaration.
exit when Decl = Empty_Node;
Result := Extended_Project_Of (Decl, In_Tree);
end loop;
With_Clause := Next_With_Clause_Of (With_Clause, In_Tree);
......
......@@ -51,8 +51,8 @@ package Restrict is
-- set from package Standard by the processing in Targparm.
Restriction_Profile_Name : array (All_Restrictions) of Profile_Name;
-- Entries in this array are valid only if the corresponding restriction
-- in Restrictions set. The value is the corresponding profile name if the
-- Entries in this array are valid only if the corresponding restriction in
-- Restrictions is set. The value is the corresponding profile name if the
-- restriction was set by a Profile or Profile_Warnings pragma. The value
-- is No_Profile in all other cases.
......@@ -148,6 +148,10 @@ package Restrict is
SPARK_05 => True,
others => False);
--------------------------
-- No_Dependences Table --
--------------------------
-- The following table records entries made by Restrictions pragmas
-- that specify a parameter for No_Dependence. Each such pragma makes
-- an entry in this table.
......@@ -179,6 +183,43 @@ package Restrict is
Table_Increment => 200,
Table_Name => "Name_No_Dependences");
----------------------------
-- No_Use_Of_Entity Table --
----------------------------
-- The following table records entries made by Restrictions pragmas
-- that specify a parameter for No_Use_Of_Entity. Each such pragma makes
-- an entry in this table.
-- Note: we have chosen to implement this restriction in the "syntactic"
-- form, where we allow arbitrary fully qualified names to be specified.
type NE_Entry is record
Entity : Node_Id;
-- The entity parameter from the No_Use_Of_Entity pragma. This is in
-- the form of a selected component, since that is the way the parser
-- processes it, and we don't further analyze it.
Warn : Boolean;
-- True if from Restriction_Warnings, False if from Restrictions
Profile : Profile_Name;
-- Set to name of profile from which No_Use_Of_Entity entry came, or to
-- No_Profile if a pragma Restriction set the No_Use_Of_Entity entry.
end record;
package No_Use_Of_Entity is new Table.Table (
Table_Component_Type => NE_Entry,
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => 200,
Table_Increment => 200,
Table_Name => "Name_No_Use_Of_Entity");
-- Note that in addition to making an entry in this table, we also set the
-- Boolean2 flag of the Name_Table entry for the simple name of the entity.
-- This is used to avoid most useless searches of this table.
-----------------
-- Subprograms --
-----------------
......
......@@ -8857,7 +8857,7 @@ package body Sem_Prag is
raise Pragma_Exit;
end if;
-- Case of No_Specification_Of_Aspect => Identifier.
-- Case of No_Specification_Of_Aspect => aspect-identifier
elsif Id = Name_No_Specification_Of_Aspect then
declare
......@@ -8877,6 +8877,8 @@ package body Sem_Prag is
end if;
end;
-- Case of No_Use_Of_Attribute => attribute-identifier
elsif Id = Name_No_Use_Of_Attribute then
if Nkind (Expr) /= N_Identifier
or else not Is_Attribute_Name (Chars (Expr))
......@@ -8887,6 +8889,15 @@ package body Sem_Prag is
Set_Restriction_No_Use_Of_Attribute (Expr, Warn);
end if;
-- Case of No_Use_Of_Entity => fully-qualified-name. Note that the
-- parser already processed this case commpletely, including error
-- checking and making an entry in the No_Use_Of_Entity table.
elsif Id = Name_No_Use_Of_Entity then
null;
-- Case of No_Use_Of_Pragma => pragma-identifier
elsif Id = Name_No_Use_Of_Pragma then
if Nkind (Expr) /= N_Identifier
or else not Is_Pragma_Name (Chars (Expr))
......
......@@ -751,6 +751,7 @@ package Snames is
Name_No_Task_Attributes : constant Name_Id := N + $;
Name_No_Task_Attributes_Package : constant Name_Id := N + $;
Name_No_Use_Of_Attribute : constant Name_Id := N + $;
Name_No_Use_Of_Entity : constant Name_Id := N + $;
Name_No_Use_Of_Pragma : constant Name_Id := N + $;
Name_No_Unroll : constant Name_Id := N + $;
Name_No_Vector : constant Name_Id := N + $;
......
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