Commit dc88759c by Javier Miranda Committed by Pierre-Marie de Rodat

[Ada] Crash compiling SPARK ghost functions with callgraph info

The compiler blows up generating the callgraph output of SPARK ghost
subprograms whose contracts invoke ghost functions.

2018-08-21  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* exp_cg.adb (Generate_CG_Output): Handle calls removed by the
	expander.

From-SVN: r263722
parent 5c0972ba
2018-08-21 Javier Miranda <miranda@adacore.com>
* exp_cg.adb (Generate_CG_Output): Handle calls removed by the
expander.
2018-08-21 Ed Schonberg <schonberg@adacore.com> 2018-08-21 Ed Schonberg <schonberg@adacore.com>
* layout.adb: Do not set size of access subprogram if unnesting. * layout.adb: Do not set size of access subprogram if unnesting.
......
...@@ -121,7 +121,14 @@ package body Exp_CG is ...@@ -121,7 +121,14 @@ package body Exp_CG is
for J in Call_Graph_Nodes.First .. Call_Graph_Nodes.Last loop for J in Call_Graph_Nodes.First .. Call_Graph_Nodes.Last loop
N := Call_Graph_Nodes.Table (J); N := Call_Graph_Nodes.Table (J);
if Nkind (N) in N_Subprogram_Call then -- No action needed for subprogram calls removed by the expander
-- (for example, calls to ignored ghost entities).
if Nkind (N) = N_Null_Statement then
pragma Assert (Nkind (Original_Node (N)) in N_Subprogram_Call);
null;
elsif Nkind (N) in N_Subprogram_Call then
Write_Call_Info (N); Write_Call_Info (N);
else pragma Assert (Nkind (N) = N_Defining_Identifier); else pragma Assert (Nkind (N) = N_Defining_Identifier);
......
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