diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-10-02 10:31:49 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-10-02 10:31:49 +0200 |
commit | 2492305bcc43dbc13678f1d6113e76b735dba432 (patch) | |
tree | 94bdc85fee142089ce51ba41c062c46dddd35534 /gcc/ada | |
parent | 9a6dc470832ec76b46cc74f749265222efbb287a (diff) | |
download | gcc-2492305bcc43dbc13678f1d6113e76b735dba432.zip gcc-2492305bcc43dbc13678f1d6113e76b735dba432.tar.gz gcc-2492305bcc43dbc13678f1d6113e76b735dba432.tar.bz2 |
[multiple changes]
2012-10-02 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Expand_N_Case_Expression): Do not introduce
indirections when the type of the alternatives is an access type:
more efficient, and removes anomalies when an alternative is
statically null.
2012-10-02 Robert Dewar <dewar@adacore.com>
* aspects.ads: Minor comment addition (Invariant is a GNAT aspect).
From-SVN: r191963
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/ada/aspects.ads | 2 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.adb | 8 |
3 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 973833b..63401fb 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2012-10-02 Ed Schonberg <schonberg@adacore.com> + + * exp_ch4.adb (Expand_N_Case_Expression): Do not introduce + indirections when the type of the alternatives is an access type: + more efficient, and removes anomalies when an alternative is + statically null. + +2012-10-02 Robert Dewar <dewar@adacore.com> + + * aspects.ads: Minor comment addition (Invariant is a GNAT aspect). + 2012-10-02 Robert Dewar <dewar@adacore.com> * exp_ch7.adb, sem_dim.adb, sem_dim.ads, prj-part.adb, checks.adb, diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 12e5e6b..3b4ebce 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -95,7 +95,7 @@ package Aspects is Aspect_Implicit_Dereference, Aspect_Input, Aspect_Interrupt_Priority, - Aspect_Invariant, + Aspect_Invariant, -- GNAT Aspect_Iterator_Element, Aspect_Link_Name, Aspect_Machine_Radix, diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index c4f6624..1bb9d63 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4797,7 +4797,7 @@ package body Exp_Ch4 is -- wrong for unconstrained types (since the bounds may not be the -- same in all branches). Furthermore it involves an extra copy -- for large objects. So we take care of this by using the following - -- modified expansion for non-scalar types: + -- modified expansion for non-elementary types: -- do -- type Pnn is access all typ; @@ -4820,7 +4820,7 @@ package body Exp_Ch4 is -- Scalar case - if Is_Scalar_Type (Typ) then + if Is_Elementary_Type (Typ) then Ttyp := Typ; else @@ -4855,7 +4855,7 @@ package body Exp_Ch4 is -- As described above, take Unrestricted_Access for case of non- -- scalar types, to avoid big copies, and special cases. - if not Is_Scalar_Type (Typ) then + if not Is_Elementary_Type (Typ) then Aexp := Make_Attribute_Reference (Aloc, Prefix => Relocate_Node (Aexp), @@ -4890,7 +4890,7 @@ package body Exp_Ch4 is -- Construct and return final expression with actions - if Is_Scalar_Type (Typ) then + if Is_Elementary_Type (Typ) then Fexp := New_Occurrence_Of (Tnn, Loc); else Fexp := |