* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178413
138bc75d-0d04-0410-961f-
82ee72b054a4
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>
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;
-------------------
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;
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;
------------------
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.
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));