Commit 363f2c58 by Arnaud Charlet

[multiple changes]

2015-10-26  Yannick Moy  <moy@adacore.com>

	* lib-xref-spark_specific.adb (Traverse_Protected_Declaration): New
	procedure for traversal.
	(Add_SPARK_Xrefs): Remove debugging code.
	(Traverse_Declaration_Or_Statement): Call the new traversal
	procedure.

2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Analyze_Pragma): Pragma
	Extensions_Visible can now appear on an abstract subprogram
	declaration.

From-SVN: r229338
parent 24fd21c3
2015-10-26 Yannick Moy <moy@adacore.com> 2015-10-26 Yannick Moy <moy@adacore.com>
* lib-xref-spark_specific.adb (Traverse_Protected_Declaration): New
procedure for traversal.
(Add_SPARK_Xrefs): Remove debugging code.
(Traverse_Declaration_Or_Statement): Call the new traversal
procedure.
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma): Pragma
Extensions_Visible can now appear on an abstract subprogram
declaration.
2015-10-26 Yannick Moy <moy@adacore.com>
* lib-xref-spark_specific.adb (Add_SPARK_Xrefs): Use character 'r' to * lib-xref-spark_specific.adb (Add_SPARK_Xrefs): Use character 'r' to
denote a reference to a constant which may have variable input, and denote a reference to a constant which may have variable input, and
thus may be treated as a variable in GNATprove, instead of the thus may be treated as a variable in GNATprove, instead of the
......
...@@ -124,10 +124,6 @@ package body SPARK_Specific is ...@@ -124,10 +124,6 @@ package body SPARK_Specific is
(N : Node_Id; (N : Node_Id;
Process : Node_Processing; Process : Node_Processing;
Inside_Stubs : Boolean); Inside_Stubs : Boolean);
procedure Traverse_Package_Declaration
(N : Node_Id;
Process : Node_Processing;
Inside_Stubs : Boolean);
procedure Traverse_Subprogram_Body procedure Traverse_Subprogram_Body
(N : Node_Id; (N : Node_Id;
Process : Node_Processing; Process : Node_Processing;
...@@ -483,12 +479,7 @@ package body SPARK_Specific is ...@@ -483,12 +479,7 @@ package body SPARK_Specific is
begin begin
for Index in SPARK_Scope_Table.First .. S - 1 loop for Index in SPARK_Scope_Table.First .. S - 1 loop
if SPARK_Scope_Table.Table (Index).Scope_Entity = E then if SPARK_Scope_Table.Table (Index).Scope_Entity = E then
declare return True;
Dummy : constant SPARK_Scope_Record :=
SPARK_Scope_Table.Table (Index);
begin
return True;
end;
end if; end if;
end loop; end loop;
...@@ -523,13 +514,13 @@ package body SPARK_Specific is ...@@ -523,13 +514,13 @@ package body SPARK_Specific is
is is
begin begin
-- The only references of interest on callable entities are calls. On -- The only references of interest on callable entities are calls. On
-- non-callable entities, the only references of interest are reads -- uncallable entities, the only references of interest are reads and
-- and writes. -- writes.
if Ekind (E) in Overloadable_Kind then if Ekind (E) in Overloadable_Kind then
return Typ = 's'; return Typ = 's';
-- Objects of Task type or protected type are not SPARK references -- Objects of task or protected types are not SPARK references
elsif Present (Etype (E)) elsif Present (Etype (E))
and then Ekind (Etype (E)) in Concurrent_Kind and then Ekind (Etype (E)) in Concurrent_Kind
...@@ -1254,7 +1245,14 @@ package body SPARK_Specific is ...@@ -1254,7 +1245,14 @@ package body SPARK_Specific is
begin begin
case Nkind (N) is case Nkind (N) is
when N_Package_Declaration => when N_Package_Declaration =>
Traverse_Package_Declaration (N, Process, Inside_Stubs); declare
Spec : constant Node_Id := Specification (N);
begin
Traverse_Declarations_Or_Statements
(Visible_Declarations (Spec), Process, Inside_Stubs);
Traverse_Declarations_Or_Statements
(Private_Declarations (Spec), Process, Inside_Stubs);
end;
when N_Package_Body => when N_Package_Body =>
if Ekind (Defining_Entity (N)) /= E_Generic_Package then if Ekind (Defining_Entity (N)) /= E_Generic_Package then
...@@ -1297,12 +1295,6 @@ package body SPARK_Specific is ...@@ -1297,12 +1295,6 @@ package body SPARK_Specific is
end; end;
end if; end if;
when N_Protected_Definition =>
Traverse_Declarations_Or_Statements
(Visible_Declarations (N), Process, Inside_Stubs);
Traverse_Declarations_Or_Statements
(Private_Declarations (N), Process, Inside_Stubs);
when N_Protected_Body => when N_Protected_Body =>
Traverse_Protected_Body (N, Process, Inside_Stubs); Traverse_Protected_Body (N, Process, Inside_Stubs);
...@@ -1318,6 +1310,16 @@ package body SPARK_Specific is ...@@ -1318,6 +1310,16 @@ package body SPARK_Specific is
end; end;
end if; end if;
when N_Protected_Type_Declaration | N_Single_Protected_Declaration =>
declare
Def : constant Node_Id := Protected_Definition (N);
begin
Traverse_Declarations_Or_Statements
(Visible_Declarations (Def), Process, Inside_Stubs);
Traverse_Declarations_Or_Statements
(Private_Declarations (Def), Process, Inside_Stubs);
end;
when N_Task_Definition => when N_Task_Definition =>
Traverse_Declarations_Or_Statements Traverse_Declarations_Or_Statements
(Visible_Declarations (N), Process, Inside_Stubs); (Visible_Declarations (N), Process, Inside_Stubs);
...@@ -1481,23 +1483,6 @@ package body SPARK_Specific is ...@@ -1481,23 +1483,6 @@ package body SPARK_Specific is
(Handled_Statement_Sequence (N), Process, Inside_Stubs); (Handled_Statement_Sequence (N), Process, Inside_Stubs);
end Traverse_Package_Body; end Traverse_Package_Body;
----------------------------------
-- Traverse_Package_Declaration --
----------------------------------
procedure Traverse_Package_Declaration
(N : Node_Id;
Process : Node_Processing;
Inside_Stubs : Boolean)
is
Spec : constant Node_Id := Specification (N);
begin
Traverse_Declarations_Or_Statements
(Visible_Declarations (Spec), Process, Inside_Stubs);
Traverse_Declarations_Or_Statements
(Private_Declarations (Spec), Process, Inside_Stubs);
end Traverse_Package_Declaration;
----------------------------- -----------------------------
-- Traverse_Protected_Body -- -- Traverse_Protected_Body --
----------------------------- -----------------------------
......
...@@ -14058,9 +14058,14 @@ package body Sem_Prag is ...@@ -14058,9 +14058,14 @@ package body Sem_Prag is
Subp_Decl := Subp_Decl :=
Find_Related_Declaration_Or_Body (N, Do_Checks => True); Find_Related_Declaration_Or_Body (N, Do_Checks => True);
-- Abstract subprogram declaration
if Nkind (Subp_Decl) = N_Abstract_Subprogram_Declaration then
null;
-- Generic subprogram declaration -- Generic subprogram declaration
if Nkind (Subp_Decl) = N_Generic_Subprogram_Declaration then elsif Nkind (Subp_Decl) = N_Generic_Subprogram_Declaration then
null; null;
-- Body acts as spec -- Body acts as spec
......
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