diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-01 15:22:54 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-01 15:22:54 +0200 |
commit | 8256c1bfeb880b42c2ce9744fa1905b4d225d792 (patch) | |
tree | 24c3025319eddf5e9e3deb5b9b0b9724561b5fbd /gcc/ada | |
parent | d1c5f4243e66f7d2c70dcebf88a4d91f2e019bcc (diff) | |
download | gcc-8256c1bfeb880b42c2ce9744fa1905b4d225d792.zip gcc-8256c1bfeb880b42c2ce9744fa1905b4d225d792.tar.gz gcc-8256c1bfeb880b42c2ce9744fa1905b4d225d792.tar.bz2 |
[multiple changes]
2011-09-01 Robert Dewar <dewar@adacore.com>
* inline.adb, sem_aggr.adb: Minor reformatting.
2011-09-01 Ed Schonberg <schonberg@adacore.com>
* a-convec.adb: Proper handling of cursors for Ada2012 iterators.
From-SVN: r178413
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/a-convec.adb | 17 | ||||
-rw-r--r-- | gcc/ada/inline.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_aggr.adb | 2 |
4 files changed, 21 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7e70cf7..2e15011 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,13 @@ 2011-09-01 Robert Dewar <dewar@adacore.com> + * inline.adb, sem_aggr.adb: Minor reformatting. + +2011-09-01 Ed Schonberg <schonberg@adacore.com> + + * a-convec.adb: Proper handling of cursors for Ada2012 iterators. + +2011-09-01 Robert Dewar <dewar@adacore.com> + * prj-proc.adb, exp_ch6.adb, prj-env.adb: Minor reformatting. 2011-09-01 Bob Duff <duff@adacore.com> diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index 08220e9..0d39ce1 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -800,9 +800,12 @@ package body Ada.Containers.Vectors is end First; function First (Object : Iterator) return Cursor is - C : constant Cursor := (Object.Container, Index_Type'First); begin - return C; + if Is_Empty (Object.Container.all) then + return No_Element; + end if; + + return Cursor'(Object.Container, Index_Type'First); end First; ------------------- @@ -2044,8 +2047,7 @@ package body Ada.Containers.Vectors is function Iterate (Container : Vector; Start : Cursor) return Vector_Iterator_Interfaces.Reversible_Iterator'class is - It : constant Iterator := - (Container'Unchecked_Access, Start.Index); + It : constant Iterator := (Container'Unchecked_Access, Start.Index); begin return It; end Iterate; @@ -2064,9 +2066,12 @@ package body Ada.Containers.Vectors is end Last; function Last (Object : Iterator) return Cursor is - C : constant Cursor := (Object.Container, Object.Container.Last); begin - return C; + if Is_Empty (Object.Container.all) then + return No_Element; + end if; + + return Cursor'(Object.Container, Object.Container.Last); end Last; ------------------ diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 98bbbf0..609c803 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -341,7 +341,7 @@ package body Inline is if Is_Generic_Instance (Pack) then null; - -- Do not inline the package if the subprogram is an init. proc + -- Do not inline the package if the subprogram is an init proc -- or other internally generated subprogram, because in that -- case the subprogram body appears in the same unit that -- declares the type, and that body is visible to the back end. diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index cdfaede..4af133c 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1229,7 +1229,7 @@ package body Sem_Aggr is elsif Is_Private_Type (Typ) and then Present (Full_View (Typ)) - and then (In_Inlined_Body or else In_Instance_Body) + and then (In_Inlined_Body or In_Instance_Body) and then Is_Composite_Type (Full_View (Typ)) then Resolve (N, Full_View (Typ)); |