diff options
| author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-20 12:35:50 +0000 |
|---|---|---|
| committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-20 12:35:50 +0000 |
| commit | 02aa46a9064ece941516f8a747ed6fd54da4c6f3 (patch) | |
| tree | 2061f4d95ed6f49ed98db0ed68e6e7fc8c3b1b58 | |
| parent | c8d81f9e7b6a8db2afe5b5ef8158c19222224acc (diff) | |
| download | ppe42-gcc-02aa46a9064ece941516f8a747ed6fd54da4c6f3.tar.gz ppe42-gcc-02aa46a9064ece941516f8a747ed6fd54da4c6f3.zip | |
* exp_ch3.adb (Make_Predefined_Primitive_Specs,
Predefined_Primitive_Bodies): Do not create the declarations and bodies
of the primitive subprograms associated with dispatching select
statements when the runtime is in configurable mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146407 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ada/ChangeLog | 2 | ||||
| -rw-r--r-- | gcc/ada/exp_ch3.adb | 80 |
2 files changed, 51 insertions, 31 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ddab7af9bf5..de647ba2ef4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -32,7 +32,7 @@ 2009-04-20 Ed Schonberg <schonberg@adacore.com> - * sem_ch8,adb (Analyze_Object_Renaming): Reject ambiguous expressions + * sem_ch8.adb (Analyze_Object_Renaming): Reject ambiguous expressions in an object renaming declaration when the expected type is an anonymous access type. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 3af685d1a9b..8b70aeb446b 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -7500,14 +7500,15 @@ package body Exp_Ch3 is (Tag_Typ : Entity_Id; Decl_List : out List_Id) is - Loc : constant Source_Ptr := Sloc (Tag_Typ); - Formal : Entity_Id; - Formal_List : List_Id; - Parent_Subp : Entity_Id; - Prim_Elmt : Elmt_Id; - Proc_Spec : Node_Id; - Proc_Decl : Node_Id; - Subp : Entity_Id; + Loc : constant Source_Ptr := Sloc (Tag_Typ); + + Formal : Entity_Id; + Formal_List : List_Id; + New_Param_Spec : Node_Id; + Parent_Subp : Entity_Id; + Prim_Elmt : Elmt_Id; + Proc_Decl : Node_Id; + Subp : Entity_Id; function Is_Null_Interface_Primitive (E : Entity_Id) return Boolean; -- Returns True if E is a null procedure that is an interface primitive @@ -7549,33 +7550,52 @@ package body Exp_Ch3 is Formal_List := New_List; while Present (Formal) loop - Append - (Make_Parameter_Specification (Loc, - Defining_Identifier => - Make_Defining_Identifier (Sloc (Formal), - Chars => Chars (Formal)), - In_Present => In_Present (Parent (Formal)), - Out_Present => Out_Present (Parent (Formal)), - Null_Exclusion_Present => - Null_Exclusion_Present (Parent (Formal)), - Parameter_Type => - New_Occurrence_Of (Etype (Formal), Loc), - Expression => - New_Copy_Tree (Expression (Parent (Formal)))), - Formal_List); + + -- Copy the parameter spec including default expressions + + New_Param_Spec := + New_Copy_Tree (Parent (Formal), New_Sloc => Loc); + + -- Generate a new defining identifier for the new formal. + -- required because New_Copy_Tree does not duplicate + -- semantic fields (except itypes). + + Set_Defining_Identifier (New_Param_Spec, + Make_Defining_Identifier (Sloc (Formal), + Chars => Chars (Formal))); + + -- For controlling arguments we must change their + -- parameter type to reference the tagged type (instead + -- of the interface type) + + if Is_Controlling_Formal (Formal) then + if Nkind (Parameter_Type (Parent (Formal))) + = N_Identifier + then + Set_Parameter_Type (New_Param_Spec, + New_Occurrence_Of (Tag_Typ, Loc)); + + else pragma Assert + (Nkind (Parameter_Type (Parent (Formal))) + = N_Access_Definition); + Set_Subtype_Mark (Parameter_Type (New_Param_Spec), + New_Occurrence_Of (Tag_Typ, Loc)); + end if; + end if; + + Append (New_Param_Spec, Formal_List); Next_Formal (Formal); end loop; end if; - Proc_Spec := - Make_Procedure_Specification (Loc, - Defining_Unit_Name => - Make_Defining_Identifier (Loc, Chars (Subp)), - Parameter_Specifications => Formal_List); - Set_Null_Present (Proc_Spec); - - Proc_Decl := Make_Subprogram_Declaration (Loc, Proc_Spec); + Proc_Decl := + Make_Subprogram_Declaration (Loc, + Make_Procedure_Specification (Loc, + Defining_Unit_Name => + Make_Defining_Identifier (Loc, Chars (Subp)), + Parameter_Specifications => Formal_List, + Null_Present => True)); Append_To (Decl_List, Proc_Decl); Analyze (Proc_Decl); end if; |

