summaryrefslogtreecommitdiffstats
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-23 08:10:49 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-23 08:10:49 +0000
commit3a72f9c3953b346b34c4de34e27deafacff9d682 (patch)
tree5d36d9c533d985f4983be828c3fca8d2fc01639f /gcc/ada/sem_attr.adb
parent549ddc37019b416667c09bc068bcbb3fef76a54b (diff)
downloadppe42-gcc-3a72f9c3953b346b34c4de34e27deafacff9d682.tar.gz
ppe42-gcc-3a72f9c3953b346b34c4de34e27deafacff9d682.zip
2012-07-23 Vincent Celier <celier@adacore.com>
* g-spitbo.adb (Substr (String)): Return full string and do not raise exception when Start is 1 and Len is exactly the length of the string parameter. * g-spitbo.ads: Fix spelling error in the name of exception Index_Error. 2012-07-23 Ed Schonberg <schonberg@adacore.com> * par.adb: new subprogram Get_Aspect_Specifications. * par-ch6.adb (P_Subprogram): handle subprogram bodies with aspect specifications. * par-ch13.adb (Get_Aspect_Specifications): extracted from P_Aspect_Specifications. Collect aspect specifications in some legal context, but do not attach them to any declaration. Used when parsing subprogram declarations or bodies that include aspect specifications. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If aspects are present, analyze them, or reject them if the subprogram as a previous spec. 2012-07-23 Vasiliy Fofanov <fofanov@adacore.com> * gnat_ugn.texi: Omit section on other platforms/runtimes support in gnattest for vms version. 2012-07-23 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Handle properly aspects that can be specified on a subprogram body: CPU, Priority, and Interrupt_Priority. 2012-07-23 Claire Dross <dross@adacore.com> * a-cfdlli.ads: Switch definition of Constant_Reference_Type and Empty_List. 2012-07-23 Thomas Quinot <quinot@adacore.com> * par_sco.adb (Process_Decisions.Output_Header): For the guard on an alternative in a SELECT statement, use the First_Sloc of the guard expression (not its topmost sloc) as the decision location, because this is what is referenced by dominance markers. 2012-07-23 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Requires_Hooking): Examine the original expression of an object declaration node because a function call that returns on the secondary stack may have been rewritten into something else. 2012-07-23 Vincent Pucci <pucci@adacore.com> * sem_dim.adb (Analyze_Dimension_Has_Etype): For identifier, propagate dimension when entity is a non-dimensionless constant. (Analyze_Dimension_Object_Declaration): Propagate dimension from the expression to the entity when type is a dimensioned type and object is a constant. 2012-07-23 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Old): if the prefix is not an entity name, expand at once so that code generated by the expansion of the prefix is not generated before the constant that captures the old value is properly inserted and analyzed. 2012-07-23 Thomas Quinot <quinot@adacore.com> * exp_ch9.adb (Ensure_Statement_Present): Mark generated NULL statement as Comes_From_Source so that GIGI does not eliminate it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189773 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index af1a8172ec4..e1abe5a048d 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4026,14 +4026,15 @@ package body Sem_Attr is
-- an entity in the enclosing subprogram. If it is a component of
-- a formal its expansion might generate actual subtypes that may
-- be referenced in an inner context, and which must be elaborated
- -- within the subprogram itself. As a result we create a
- -- declaration for it and insert it at the start of the enclosing
- -- subprogram. This is properly an expansion activity but it has
- -- to be performed now to prevent out-of-order issues.
-
- if Nkind (P) = N_Selected_Component
- and then Has_Discriminants (Etype (Prefix (P)))
- then
+ -- within the subprogram itself. If the prefix includes a function
+ -- call it may involve finalization actions that should only be
+ -- inserted when the attribute has been rewritten as a declarations.
+ -- As a result, if the prefix is not a simple name we create a
+ -- declaration for it now, and insert it at the start of the
+ -- enclosing subprogram. This is properly an expansion activity but
+ -- it has to be performed now to prevent out-of-order issues.
+
+ if not Is_Entity_Name (P) then
P_Type := Base_Type (P_Type);
Set_Etype (N, P_Type);
Set_Etype (P, P_Type);
OpenPOWER on IntegriCloud