Commit 28d6470f by Javier Miranda Committed by Arnaud Charlet

sem_ch4.adb (Try_Object_Operation): Reformat the code to expand in-line the code…

sem_ch4.adb (Try_Object_Operation): Reformat the code to expand in-line the code corresponding to subprogram...

2004-10-04  Javier Miranda  <miranda@gnat.com>

	* sem_ch4.adb (Try_Object_Operation): Reformat the code to expand
	in-line the code corresponding to subprogram Analyze_Actuals. In
	addition, analyze the actuals only in case of subprogram call.

From-SVN: r88506
parent 06237875
2004-10-04 Javier Miranda <miranda@gnat.com>
* sem_ch4.adb (Try_Object_Operation): Reformat the code to expand
in-line the code corresponding to subprogram Analyze_Actuals. In
addition, analyze the actuals only in case of subprogram call.
2004-10-04 Ed Falis <falis@gnat.com> 2004-10-04 Ed Falis <falis@gnat.com>
* s-vxwork-x86.ads: (FP_CONTEXT): Defined to be correct size * s-vxwork-x86.ads: (FP_CONTEXT): Defined to be correct size
......
...@@ -4637,19 +4637,19 @@ package body Sem_Ch4 is ...@@ -4637,19 +4637,19 @@ package body Sem_Ch4 is
-------------------------- --------------------------
function Try_Object_Operation (N : Node_Id) return Boolean is function Try_Object_Operation (N : Node_Id) return Boolean is
K : constant Node_Kind := Nkind (Parent (N));
Loc : constant Source_Ptr := Sloc (N); Loc : constant Source_Ptr := Sloc (N);
Is_Subprg_Call : constant Boolean := K = N_Procedure_Call_Statement
or else K = N_Function_Call;
Obj : constant Node_Id := Prefix (N); Obj : constant Node_Id := Prefix (N);
Obj_Type : Entity_Id := Etype (Obj);
Subprog : constant Node_Id := Selector_Name (N); Subprog : constant Node_Id := Selector_Name (N);
Actual : Node_Id;
Call_Node : Node_Id; Call_Node : Node_Id;
Call_Node_Case : Node_Id := Empty; Call_Node_Case : Node_Id := Empty;
First_Actual : Node_Id; First_Actual : Node_Id;
Node_To_Replace : Node_Id; Node_To_Replace : Node_Id;
Obj_Type : Entity_Id := Etype (Obj);
procedure Analyze_Actuals;
-- If the parent of N is a subprogram call, then analyze the actual
-- parameters of the parent of N.
procedure Complete_Object_Operation procedure Complete_Object_Operation
(Call_Node : Node_Id; (Call_Node : Node_Id;
...@@ -4681,32 +4681,6 @@ package body Sem_Ch4 is ...@@ -4681,32 +4681,6 @@ package body Sem_Ch4 is
-- Traverse the list of primitive subprograms looking for a subprogram -- Traverse the list of primitive subprograms looking for a subprogram
-- than matches Subprog. -- than matches Subprog.
---------------------
-- Analyze_Actuals --
---------------------
procedure Analyze_Actuals is
Actual : Node_Id;
begin
if (Nkind (Parent (N)) = N_Procedure_Call_Statement
or else
Nkind (Parent (N)) = N_Function_Call)
-- Avoid recursive calls
and then N /= First (Parameter_Associations (Parent (N)))
then
Actual := First (Parameter_Associations (Parent (N)));
while Present (Actual) loop
Analyze (Actual);
Check_Parameterless_Call (Actual);
Next (Actual);
end loop;
end if;
end Analyze_Actuals;
------------------------------- -------------------------------
-- Complete_Object_Operation -- -- Complete_Object_Operation --
------------------------------- -------------------------------
...@@ -4993,7 +4967,16 @@ package body Sem_Ch4 is ...@@ -4993,7 +4967,16 @@ package body Sem_Ch4 is
Obj_Type := Etype (Class_Wide_Type (Obj_Type)); Obj_Type := Etype (Class_Wide_Type (Obj_Type));
end if; end if;
Analyze_Actuals; -- Analyze the actuals in case of subprogram call
if Is_Subprg_Call and then N = Name (Parent (N)) then
Actual := First (Parameter_Associations (Parent (N)));
while Present (Actual) loop
Analyze (Actual);
Check_Parameterless_Call (Actual);
Next (Actual);
end loop;
end if;
-- If the object is of an Access type, explicit dereference is -- If the object is of an Access type, explicit dereference is
-- required. -- required.
......
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