summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_tss.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-29 13:29:08 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-29 13:29:08 +0000
commit294b942d56cb4d7f0f03ccf70294e48b90710e31 (patch)
tree11c0c448c05a05a2157e938de8190ca731911a8b /gcc/ada/exp_tss.ads
parentcfd7609b9effe843b82c81122d175c0474a4dc2a (diff)
downloadgcc-294b942d56cb4d7f0f03ccf70294e48b90710e31.tar.gz
2009-04-29 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Disable error message associated with dyamically tagged expressions if the expression initializing a tagged type corresponds with a non default CPP constructor. (OK_For_Limited_Init): CPP constructor calls are OK for initialization of limited type objects. * sem_ch5.adb (Analyze_Assignment): Improve the error message reported when a CPP constructor is called in an assignment. Disable also the error message associated with dyamically tagged expressions if the exporession initializing a tagged type corresponds with a non default CPP constructor. * sem_prag.adb (Analyze_Pragma): Remove code disabling the use of non-default C++ constructors. * sem_util.ads, sem_util.adb (Is_CPP_Constructor_Call): New subprogram. * exp_tss.ads, exp_tss.adb (Base_Init_Proc): Add support for non-default constructors. (Init_Proc): Add support for non-default constructors. * exp_disp.adb (Set_Default_Constructor): Removed. (Set_CPP_Constructors): Code based in removed Set_Default_Constructor but extending its functionality to handle non-default constructors. * exp_aggr.adb (Build_Record_Aggr_Code): Add support for non-default constructors. Minor code cleanup removing unrequired label and goto statement. * exp_ch3.adb (Build_Initialization_Call): Add support for non-default constructors. (Build_Init_Statements): Add support for non-default constructors. (Expand_N_Object_Declaration): Add support for non-default constructors. (Freeze_Record_Type): Replace call to Set_Default_Constructor by call to Set_CPP_Constructors. * exp_ch5.adb (Expand_N_Assignment_Statement): Add support for non-default constructors. Required to handle its use in build-in-place statements. * gnat_rm.texi (CPP_Constructor): Document new extended use of this pragma for non-default C++ constructors and the new compiler support that allows the use of these constructors in record components, limited aggregates, and extended return statements. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146966 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_tss.ads')
-rw-r--r--gcc/ada/exp_tss.ads22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ada/exp_tss.ads b/gcc/ada/exp_tss.ads
index e72e38cc2c0..b81199ccf29 100644
--- a/gcc/ada/exp_tss.ads
+++ b/gcc/ada/exp_tss.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -187,8 +187,9 @@ package Exp_Tss is
-- used to initially install a TSS in the case where the subprogram for the
-- TSS has already been created and its declaration processed.
- function Init_Proc (Typ : Entity_Id) return Entity_Id;
- pragma Inline (Init_Proc);
+ function Init_Proc
+ (Typ : Entity_Id;
+ Ref : Entity_Id := Empty) return Entity_Id;
-- Obtains the _init TSS entry for the given type. This function call is
-- equivalent to TSS (Typ, Name_uInit). The _init TSS is the procedure
-- used to initialize otherwise uninitialized instances of a type. If
@@ -198,14 +199,21 @@ package Exp_Tss is
-- the corresponding base type (see Base_Init_Proc function). A special
-- case arises for concurrent types. Such types do not themselves have an
-- init proc TSS, but initialization is required. The init proc used is
- -- the one for the corresponding record type (see Base_Init_Proc).
+ -- the one for the corresponding record type (see Base_Init_Proc). If
+ -- Ref is present it is call to a subprogram whose profile matches the
+ -- profile of the required constructor (this argument is used to handle
+ -- non-default CPP constructors).
- function Base_Init_Proc (Typ : Entity_Id) return Entity_Id;
+ function Base_Init_Proc
+ (Typ : Entity_Id;
+ Ref : Entity_Id := Empty) return Entity_Id;
-- Obtains the _Init TSS entry from the base type of the entity, and also
-- deals with going indirect through the Corresponding_Record_Type field
-- for concurrent objects (which are initialized with the initialization
- -- routine for the corresponding record type). Returns Empty if there is
- -- no _Init TSS entry for the base type.
+ -- routine for the corresponding record type). Returns Empty if there is no
+ -- _Init TSS entry for the base type. If Ref is present it is a call to a
+ -- subprogram whose profile matches the profile of the required constructor
+ -- (this argument is used to handle non-default CPP constructors).
procedure Set_Init_Proc (Typ : Entity_Id; Init : Entity_Id);
pragma Inline (Set_Init_Proc);