summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 11:00:13 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 11:00:13 +0000
commit4360281887d2c5cb25db5b7b8a0393d61e5831e5 (patch)
treeaa31cbc8e6e668e5151abda35b023b5a3b2ef393 /gcc/ada/sem_ch6.adb
parentf7416623774e14d425e23d3f0521d0716a97c9f1 (diff)
downloadgcc-4360281887d2c5cb25db5b7b8a0393d61e5831e5.tar.gz
2011-10-13 Cyrille Comar <comar@adacore.com>
* gnat_ugn.texi: Minor editing. 2011-10-13 Vincent Celier <celier@adacore.com> * projects.texi: Add documentation on packages and attributes that are inherited from a project being extended into the extended project. 2011-10-13 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch3.adb (Build_Master): Rewritten. (Expand_N_Full_Type_Declaration): Reformat the declarative region. Update the call to Build_Master_Renaming. (Expand_Previous_Access_Type): Rewritten. * exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): Add local constant Result_Subt and update related usage. (Expand_N_Extended_Return_Statement): Add local constant Result_Subt and update related usage. * exp_ch9.adb (Build_Activation_Chain): Rewritten to use the new context detection mechanism. (Build_Class_Wide_Master): Use Insert_Action to add the renaming into the tree. (Build_Master_Entity): Rewritten to use the new context detection mechanism. (Build_Master_Renaming): Add formal parameter Ins_Nod and related usage. Use Insert_Action to add the renaming into the tree. (Find_Enclosing_Context): New subsidiary routine. Rather than relying on enclosing scopes, this routine looks at the tree structure to figure out the proper context for a _master or a _chain. This approach eliminates the issues with transient scopes which have not been converted into blocks. * exp_ch9.ads (Build_Master_Entity): Change parameter profile to better reflect the new usage. Update the related comment. (Build_Master_Renaming): Add formal parameter Ins_Nod. Update the comment on usage. * sem_ch3.adb (Access_Definition): Update the calls to Build_Master_Entity and Build_Master_Renaming. * sem_ch6.adb (Create_Extra_Formals): Add local variable Full_Subt. Code reformatting. * sem_util.adb (Is_Iterator): Alphabetized. (Is_LHS): Alphabetized. (Is_Limited_Class_Wide_Type): New routine. * sem_util.ads (Is_Limited_Class_Wide_Type): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179913 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb44
1 files changed, 21 insertions, 23 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index c6ce39aa585..a92f7e01129 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -6461,9 +6461,11 @@ package body Sem_Ch6 is
if Ada_Version >= Ada_2005 and then Is_Build_In_Place_Function (E) then
declare
Result_Subt : constant Entity_Id := Etype (E);
+ Full_Subt : constant Entity_Id := Available_View (Result_Subt);
- Discard : Entity_Id;
+ Discard : Entity_Id;
pragma Warnings (Off, Discard);
+ Formal_Typ : Entity_Id;
begin
-- In the case of functions with unconstrained result subtypes,
@@ -6510,7 +6512,7 @@ package body Sem_Ch6 is
-- master of the tasks to be created, and the caller's activation
-- chain.
- if Has_Task (Available_View (Result_Subt)) then
+ if Has_Task (Full_Subt) then
Discard :=
Add_Extra_Formal
(E, RTE (RE_Master_Id),
@@ -6524,31 +6526,27 @@ package body Sem_Ch6 is
-- All build-in-place functions get an extra formal that will be
-- passed the address of the return object within the caller.
- declare
- Formal_Type : constant Entity_Id :=
- Create_Itype
- (E_Anonymous_Access_Type, E,
- Scope_Id => Scope (E));
- begin
- Set_Directly_Designated_Type (Formal_Type, Result_Subt);
- Set_Etype (Formal_Type, Formal_Type);
- Set_Depends_On_Private
- (Formal_Type, Has_Private_Component (Formal_Type));
- Set_Is_Public (Formal_Type, Is_Public (Scope (Formal_Type)));
- Set_Is_Access_Constant (Formal_Type, False);
+ Formal_Typ :=
+ Create_Itype (E_Anonymous_Access_Type, E, Scope_Id => Scope (E));
- -- Ada 2005 (AI-50217): Propagate the attribute that indicates
- -- the designated type comes from the limited view (for
- -- back-end purposes).
+ Set_Directly_Designated_Type (Formal_Typ, Result_Subt);
+ Set_Etype (Formal_Typ, Formal_Typ);
+ Set_Depends_On_Private
+ (Formal_Typ, Has_Private_Component (Formal_Typ));
+ Set_Is_Public (Formal_Typ, Is_Public (Scope (Formal_Typ)));
+ Set_Is_Access_Constant (Formal_Typ, False);
- Set_From_With_Type (Formal_Type, From_With_Type (Result_Subt));
+ -- Ada 2005 (AI-50217): Propagate the attribute that indicates
+ -- the designated type comes from the limited view (for back-end
+ -- purposes).
- Layout_Type (Formal_Type);
+ Set_From_With_Type (Formal_Typ, From_With_Type (Result_Subt));
- Discard :=
- Add_Extra_Formal
- (E, Formal_Type, E, BIP_Formal_Suffix (BIP_Object_Access));
- end;
+ Layout_Type (Formal_Typ);
+
+ Discard :=
+ Add_Extra_Formal
+ (E, Formal_Typ, E, BIP_Formal_Suffix (BIP_Object_Access));
end;
end if;
end Create_Extra_Formals;