for J in Call_Graph_Nodes.First .. Call_Graph_Nodes.Last loop
N := Call_Graph_Nodes.Table (J);
- -- 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
+ if Nkind (N) in N_Subprogram_Call then
Write_Call_Info (N);
else pragma Assert (Nkind (N) = N_Defining_Identifier);
procedure Register_CG_Node (N : Node_Id) is
begin
- if Nkind (N) in N_Subprogram_Call then
+ -- Skip ignored ghost calls that will be removed by the expander
+
+ if Is_Ignored_Ghost_Node (N) then
+ null;
+
+ elsif Nkind (N) in N_Subprogram_Call then
+
if Current_Scope = Main_Unit_Entity
or else Entity_Is_In_Main_Unit (Current_Scope)
then