aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@gnat.com>2004-10-04 15:01:03 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2004-10-04 17:01:03 +0200
commit28d6470f55e9975b037aa698407939635e28e4c6 (patch)
tree6722ac6069cb369357c9c483ae95acc3b4e8244f
parent06237875d46c4e937110bac2c58a540915a12f2c (diff)
downloadgcc-28d6470f55e9975b037aa698407939635e28e4c6.zip
gcc-28d6470f55e9975b037aa698407939635e28e4c6.tar.gz
gcc-28d6470f55e9975b037aa698407939635e28e4c6.tar.bz2
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
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_ch4.adb55
2 files changed, 25 insertions, 36 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0200474..85551cb 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+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>
* s-vxwork-x86.ads: (FP_CONTEXT): Defined to be correct size
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index ba7e46a..a63d78e 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4637,19 +4637,19 @@ package body Sem_Ch4 is
--------------------------
function Try_Object_Operation (N : Node_Id) return Boolean is
- Loc : constant Source_Ptr := Sloc (N);
- Obj : constant Node_Id := Prefix (N);
- Obj_Type : Entity_Id := Etype (Obj);
- Subprog : constant Node_Id := Selector_Name (N);
-
+ K : constant Node_Kind := Nkind (Parent (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);
+ Subprog : constant Node_Id := Selector_Name (N);
+
+ Actual : Node_Id;
Call_Node : Node_Id;
Call_Node_Case : Node_Id := Empty;
First_Actual : Node_Id;
Node_To_Replace : Node_Id;
-
- procedure Analyze_Actuals;
- -- If the parent of N is a subprogram call, then analyze the actual
- -- parameters of the parent of N.
+ Obj_Type : Entity_Id := Etype (Obj);
procedure Complete_Object_Operation
(Call_Node : Node_Id;
@@ -4681,32 +4681,6 @@ package body Sem_Ch4 is
-- Traverse the list of primitive subprograms looking for a subprogram
-- 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 --
-------------------------------
@@ -4993,7 +4967,16 @@ package body Sem_Ch4 is
Obj_Type := Etype (Class_Wide_Type (Obj_Type));
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
-- required.