Commit 1384d88f by Yannick Moy Committed by Pierre-Marie de Rodat

[Ada] Expose part of ownership checking for use in GNATprove

GNATprove needs to be able to call a subset of the ownership legality
rules from marking. This is provided by a new function
Sem_SPARK.Is_Legal.

There is no impact on compilation.

2019-08-14  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_spark.adb, sem_spark.ads (Is_Legal): New function exposed
	for use in GNATprove, to test legality rules not related to
	permissions.
	(Check_Declaration_Legality): Extract the part of
	Check_Declaration that checks rules not related to permissions.
	(Check_Declaration): Call the new Check_Declaration_Legality.
	(Check_Type_Legality): Rename of Check_Type. Introduce
	parameters to force or not checking, and update a flag detecting
	illegalities.
	(Check_Node): Ignore attribute references in statement position.

From-SVN: r274454
parent 05b77088
2019-08-14 Yannick Moy <moy@adacore.com>
* sem_spark.adb, sem_spark.ads (Is_Legal): New function exposed
for use in GNATprove, to test legality rules not related to
permissions.
(Check_Declaration_Legality): Extract the part of
Check_Declaration that checks rules not related to permissions.
(Check_Declaration): Call the new Check_Declaration_Legality.
(Check_Type_Legality): Rename of Check_Type. Introduce
parameters to force or not checking, and update a flag detecting
illegalities.
(Check_Node): Ignore attribute references in statement position.
2019-08-14 Yannick Moy <moy@adacore.com>
* sem_spark.adb (Check_Old_Loop_Entry): New procedure to check
correct use of Old and Loop_Entry.
(Check_Node): Check subprogram contracts.
......
......@@ -152,6 +152,12 @@ generic
package Sem_SPARK is
function Is_Legal (N : Node_Id) return Boolean;
-- Test the legality of a node wrt ownership-checking rules. This does not
-- check rules related to the validity of permissions associated with paths
-- from objects, so that it can be called from GNATprove on code of library
-- units analyzed in SPARK_Mode Auto.
procedure Check_Safe_Pointers (N : Node_Id);
-- The entry point of this package. It analyzes a node and reports errors
-- when there are violations of ownership rules.
......
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