diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-28 13:41:05 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-28 13:41:05 +0000 |
commit | 36e5d81f101c7b68abacda159723e025c64d32ea (patch) | |
tree | 0ec6ddca28d1acb07647a4b52045e1a5b622bdb8 /gcc/ada/exp_attr.adb | |
parent | c4853f2e3cc64aad591da8e9c5609e60279290b9 (diff) | |
download | gcc-36e5d81f101c7b68abacda159723e025c64d32ea.tar.gz |
2009-10-28 Thomas Quinot <quinot@adacore.com>
* exp_ch4.adb (Expand_N_Type_Conversion): Perform Integer promotion for
the operand of the unary minus and ABS operators.
* sem_type.adb (Covers): A concurrent type and its corresponding record
type are compatible.
* exp_attr.adb (Expand_N_Attribute_Reference): Do not rewrite a 'Access
attribute reference for the current instance of a protected type while
analyzing an access discriminant constraint in a component definition.
Such a reference is handled in the corresponding record's init proc,
while initializing the constrained component.
* exp_ch9.adb (Expand_N_Protected_Type_Declaration): When creating the
corresponding record type, propagate components'
Has_Per_Object_Constraint flag.
* exp_ch3.adb (Build_Init_Procedure.Build_Init_Statements):
For a concurrent type, set up concurrent aspects before initializing
components with a per object constrain, because they may be controlled,
and their initialization may call entries or protected subprograms of
the enclosing concurrent object.
2009-10-28 Emmanuel Briot <briot@adacore.com>
* prj-nmsc.adb (Add_If_Not_In_List): New subprogram, for better sharing
of code.
(Find_Source_Dirs): resolve links if Opt.Follow_Links_For_Dirs when
processing the directories specified explicitly in the project file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153657 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_attr.adb')
-rw-r--r-- | gcc/ada/exp_attr.adb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index d5cce9b43ee..67babece63d 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -654,10 +654,20 @@ package body Exp_Attr is Make_Build_In_Place_Call_In_Anonymous_Context (Pref); end if; - -- If prefix is a protected type name, this is a reference to - -- the current instance of the type. - - if Is_Protected_Self_Reference (Pref) then + -- If prefix is a protected type name, this is a reference to the + -- current instance of the type. For a component definition, nothing + -- to do (expansion will occur in the init proc). In other contexts, + -- rewrite into reference to current instance. + + if Is_Protected_Self_Reference (Pref) + and then not + (Nkind_In (Parent (N), + N_Index_Or_Discriminant_Constraint, + N_Discriminant_Association) + and then + Nkind (Parent (Parent (Parent (Parent (N))))) + = N_Component_Definition) + then Rewrite (Pref, Concurrent_Ref (Pref)); Analyze (Pref); end if; |