aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-cofove.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 17:51:58 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 17:51:58 +0100
commitc6d2191a0da9f40899da20933f008242f90262e0 (patch)
tree3a271858d673fb57c047135e5a838d33e1ee5af4 /gcc/ada/a-cofove.adb
parentec77b14454cfb80c70a0b17b7ced31c8956af30b (diff)
downloadgcc-c6d2191a0da9f40899da20933f008242f90262e0.zip
gcc-c6d2191a0da9f40899da20933f008242f90262e0.tar.gz
gcc-c6d2191a0da9f40899da20933f008242f90262e0.tar.bz2
[multiple changes]
2014-02-24 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Global_Item): Emit the variable related checks concerning volatile objects only when SPARK_Mode is on. 2014-02-24 Robert Dewar <dewar@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): use Error_Msg_Ada_2012_Feature. 2014-02-24 Jose Ruiz <ruiz@adacore.com> * s-rident.ads (Profile_Info): For Ravenscar, the restrictions No_Local_Timing_Events and No_Specific_Termination_Handlers must be set, according to the Ravenscar profile definition in D.13(6/3). 2014-02-24 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): If this is a completion, freeze return type and its designated type if needed. 2014-02-24 Thomas Quinot <quinot@adacore.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case 'Address): When moving initialization statements to a freeze entity, keep them under a single node (i.e. do not unwrap expressions with actions), and set the Initialization_Statements attribute again so that processing of a later pragma Import can still remove them. 2014-02-24 Claire Dross <dross@adacore.com> * a-cfdlli.adb, a-cfdlli.ads, a-cfhama.adb, a-cfhama.ads, a-cfhase.adb, a-cfhase.ads, a-cforma.adb, a-cforma.ads, a-cforse.adb, a-cforse.ads, a-cofove.adb, a-cofove.ads: Rename Left/Right to First_To_Previous/Current_To_Last. 2014-02-24 Thomas Quinot <quinot@adacore.com> * adaint.h (struct file_attributes): New component "error" (__gnat_error_attributes): Accessor for the above. * adaint.c (__gnat_error_attributes): New subprogram (__gnat_stat): Fix returned value (expect errno value) (__gnat_stat_to_attr): Add management of error component (set to stat errno value, except for missing files where it is set to 0, and exists is set to 0). * osint.ads (File_Attributes_Size): Update per change above, also clarify documentation. * s-filatt.ads: New file, binding to file attributes related functions. * Makefile.rtl (s-filatt): New runtime unit. * s-crtl.ads (strlen): Expose binding to GCC builtin (falls back to library function if not available on target). * s-os_lib.ads, s-os_lib.adb (Errno_Message): New subprogram. * s-oscons-tmplt.c (SIZEOF_struct_file_attributes, SIZEOF_struct_dirent_alloc): New constants. * Make-generated.in (s-oscons.ads): Now requires adaint.h. * a-direct.adb (Fetch_Next_Entry): Fix incorrect buffer sizes. Perform appropriate error checking if stat fails (do not just ignore existing files if stat fails) * gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS): Update dependencies. From-SVN: r208078
Diffstat (limited to 'gcc/ada/a-cofove.adb')
-rw-r--r--gcc/ada/a-cofove.adb96
1 files changed, 50 insertions, 46 deletions
diff --git a/gcc/ada/a-cofove.adb b/gcc/ada/a-cofove.adb
index d76055c..8199084 100644
--- a/gcc/ada/a-cofove.adb
+++ b/gcc/ada/a-cofove.adb
@@ -313,6 +313,32 @@ package body Ada.Containers.Formal_Vectors is
end return;
end Copy;
+ ---------------------
+ -- Current_To_Last --
+ ---------------------
+
+ function Current_To_Last
+ (Container : Vector;
+ Current : Cursor) return Vector is
+ C : Vector (Container.Capacity) := Copy (Container, Container.Capacity);
+
+ begin
+ if Current = No_Element then
+ Clear (C);
+ return C;
+ end if;
+
+ if not Has_Element (Container, Current) then
+ raise Constraint_Error;
+ end if;
+
+ while C.Last /= Container.Last - Current.Index + 1 loop
+ Delete_First (C);
+ end loop;
+
+ return C;
+ end Current_To_Last;
+
------------
-- Delete --
------------
@@ -578,6 +604,30 @@ package body Ada.Containers.Formal_Vectors is
return Index_Type'First;
end First_Index;
+ -----------------------
+ -- First_To_Previous --
+ -----------------------
+
+ function First_To_Previous
+ (Container : Vector;
+ Current : Cursor) return Vector is
+ C : Vector (Container.Capacity) := Copy (Container, Container.Capacity);
+
+ begin
+ if Current = No_Element then
+ return C;
+ end if;
+
+ if not Has_Element (Container, Current) then
+ raise Constraint_Error;
+ end if;
+
+ while C.Last /= Current.Index - 1 loop
+ Delete_Last (C);
+ end loop;
+ return C;
+ end First_To_Previous;
+
---------------------
-- Generic_Sorting --
---------------------
@@ -1165,28 +1215,6 @@ package body Ada.Containers.Formal_Vectors is
end Length;
----------
- -- Left --
- ----------
-
- function Left (Container : Vector; Position : Cursor) return Vector is
- C : Vector (Container.Capacity) := Copy (Container, Container.Capacity);
-
- begin
- if Position = No_Element then
- return C;
- end if;
-
- if not Has_Element (Container, Position) then
- raise Constraint_Error;
- end if;
-
- while C.Last /= Position.Index - 1 loop
- Delete_Last (C);
- end loop;
- return C;
- end Left;
-
- ----------
-- Move --
----------
@@ -1459,30 +1487,6 @@ package body Ada.Containers.Formal_Vectors is
return No_Index;
end Reverse_Find_Index;
- -----------
- -- Right --
- -----------
-
- function Right (Container : Vector; Position : Cursor) return Vector is
- C : Vector (Container.Capacity) := Copy (Container, Container.Capacity);
-
- begin
- if Position = No_Element then
- Clear (C);
- return C;
- end if;
-
- if not Has_Element (Container, Position) then
- raise Constraint_Error;
- end if;
-
- while C.Last /= Container.Last - Position.Index + 1 loop
- Delete_First (C);
- end loop;
-
- return C;
- end Right;
-
----------------
-- Set_Length --
----------------