Commit 5913d1b7 by Yannick Moy Committed by Pierre-Marie de Rodat

[Ada] Fix inlining of subprograms with deep param/result in GNATprove

2019-10-10  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not peek
	under private types whose completion is SPARK_Mode Off.

From-SVN: r276833
parent 60f66f34
2019-10-10 Gary Dismukes <dismukes@adacore.com> 2019-10-10 Yannick Moy <moy@adacore.com>
* exp_ch4.adb, sem_cat.adb, sem_ch12.adb, sem_ch3.adb, * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not peek
sem_ch6.adb, sem_prag.adb, sem_util.adb, sem_util.ads: Minor under private types whose completion is SPARK_Mode Off.
typo fixes. \ No newline at end of file
\ No newline at end of file
...@@ -1582,6 +1582,20 @@ package body Inline is ...@@ -1582,6 +1582,20 @@ package body Inline is
if No (Underlying_Type (Typ)) then if No (Underlying_Type (Typ)) then
return True; return True;
-- Do not peek under a private type if its completion has
-- SPARK_Mode Off. In such a case, a deep type is considered
-- by GNATprove to be not deep.
elsif Present (Full_View (Typ))
and then Present (SPARK_Pragma (Full_View (Typ)))
and then Get_SPARK_Mode_From_Annotation
(SPARK_Pragma (Full_View (Typ))) = Off
then
return False;
-- Otherwise peek under the private type.
else else
return Is_Deep (Underlying_Type (Typ)); return Is_Deep (Underlying_Type (Typ));
end if; end if;
......
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