From 27ebda1930cef2ac484abcca124a4d6230feee08 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Mon, 19 Aug 2019 08:37:03 +0000 Subject: [PATCH] [Ada] Import documentation from the RM for various runtime units 2019-08-19 Pierre-Marie de Rodat gcc/ada/ * libgnat/a-cgaaso.ads, libgnat/a-cgarso.ads, libgnat/a-cogeso.ads, libgnat/a-contai.ads, libgnat/a-locale.ads: Import documentation from the RM. From-SVN: r274659 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/libgnat/a-cgaaso.ads | 13 +++++++++++++ gcc/ada/libgnat/a-cgarso.ads | 16 +++++++++++++--- gcc/ada/libgnat/a-cogeso.ads | 16 ++++++++++++++++ gcc/ada/libgnat/a-contai.ads | 4 ++++ gcc/ada/libgnat/a-locale.ads | 16 ++++++++++++++++ 6 files changed, 68 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1c983054fa3..561e091f8f5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2019-08-19 Pierre-Marie de Rodat + + * libgnat/a-cgaaso.ads, libgnat/a-cgarso.ads, + libgnat/a-cogeso.ads, libgnat/a-contai.ads, + libgnat/a-locale.ads: Import documentation from the RM. + 2019-08-19 Jerome Guitton * Makefile.rtl (system.o): New target to add generation of diff --git a/gcc/ada/libgnat/a-cgaaso.ads b/gcc/ada/libgnat/a-cgaaso.ads index 60bfd224b62..3622702c6b2 100644 --- a/gcc/ada/libgnat/a-cgaaso.ads +++ b/gcc/ada/libgnat/a-cgaaso.ads @@ -39,3 +39,16 @@ generic procedure Ada.Containers.Generic_Anonymous_Array_Sort (First, Last : Index_Type'Base); pragma Pure (Ada.Containers.Generic_Anonymous_Array_Sort); +-- Reorders the elements of Container such that the elements are sorted +-- smallest first as determined by the generic formal "<" operator provided. +-- Any exception raised during evaluation of "<" is propagated. +-- +-- The actual function for the generic formal function "<" is expected to +-- return the same value each time it is called with a particular pair of +-- element values. It should not modify Container and it should define a +-- strict weak ordering relationship: irreflexive, asymmetric, transitive, and +-- in addition, if x < y for any values x and y, then for all other values z, +-- (x < z) or (z < y). If the actual for "<" behaves in some other manner, +-- the behavior of the instance of Generic_Anonymous_Array_Sort is +-- unspecified. The number of times Generic_Anonymous_Array_Sort calls "<" is +-- unspecified. diff --git a/gcc/ada/libgnat/a-cgarso.ads b/gcc/ada/libgnat/a-cgarso.ads index 77281b5ef45..1a646736b1b 100644 --- a/gcc/ada/libgnat/a-cgarso.ads +++ b/gcc/ada/libgnat/a-cgarso.ads @@ -18,9 +18,19 @@ generic type Element_Type is private; type Array_Type is array (Index_Type range <>) of Element_Type; - with function "<" (Left, Right : Element_Type) - return Boolean is <>; + with function "<" (Left, Right : Element_Type) return Boolean is <>; procedure Ada.Containers.Generic_Array_Sort (Container : in out Array_Type); - pragma Pure (Ada.Containers.Generic_Array_Sort); +-- Reorders the elements of Container such that the elements are sorted +-- smallest first as determined by the generic formal "<" operator provided. +-- Any exception raised during evaluation of "<" is propagated. +-- +-- The actual function for the generic formal function "<" is expected to +-- return the same value each time it is called with a particular pair of +-- element values. It should not modify Container and it should define a +-- strict weak ordering relationship: irreflexive, asymmetric, transitive, and +-- in addition, if x < y for any values x and y, then for all other values z, +-- (x < z) or (z < y). If the actual for "<" behaves in some other manner, +-- the behavior of the instance of Generic_Array_Sort is unspecified. The +-- number of times Generic_Array_Sort calls "<" is unspecified. diff --git a/gcc/ada/libgnat/a-cogeso.ads b/gcc/ada/libgnat/a-cogeso.ads index a7070721a3f..e77558f5f3e 100644 --- a/gcc/ada/libgnat/a-cogeso.ads +++ b/gcc/ada/libgnat/a-cogeso.ads @@ -38,3 +38,19 @@ generic procedure Ada.Containers.Generic_Sort (First, Last : Index_Type'Base); pragma Pure (Ada.Containers.Generic_Sort); +-- Reorders the elements of an indexable structure, over the range +-- First .. Last, such that the elements are sorted in the ordering determined +-- by the generic formal function Before; Before should return True if Left is +-- to be sorted before Right. The generic formal Before compares the elements +-- having the given indices, and the generic formal Swap exchanges the values +-- of the indicated elements. Any exception raised during evaluation of Before +-- or Swap is propagated. +-- +-- The actual function for the generic formal function "<" is expected to +-- return the same value each time it is called with a particular pair of +-- element values. It should not modify Container and it should define a +-- strict weak ordering relationship: irreflexive, asymmetric, transitive, and +-- in addition, if x < y for any values x and y, then for all other values z, +-- (x < z) or (z < y). If the actual for "<" behaves in some other manner, +-- the behavior of the instance of Generic_Sort is unspecified. The number of +-- times Generic_Sort calls "<" is unspecified. diff --git a/gcc/ada/libgnat/a-contai.ads b/gcc/ada/libgnat/a-contai.ads index be8a808747b..d6189a30650 100644 --- a/gcc/ada/libgnat/a-contai.ads +++ b/gcc/ada/libgnat/a-contai.ads @@ -17,8 +17,12 @@ package Ada.Containers is pragma Pure; type Hash_Type is mod 2**32; + -- Represents the range of the result of a hash function + type Count_Type is range 0 .. 2**31 - 1; + -- Represents the (potential or actual) number of elements of a container Capacity_Error : exception; + -- Raised when the capacity of a container is exceeded end Ada.Containers; diff --git a/gcc/ada/libgnat/a-locale.ads b/gcc/ada/libgnat/a-locale.ads index 43ba5bf33db..314001ab600 100644 --- a/gcc/ada/libgnat/a-locale.ads +++ b/gcc/ada/libgnat/a-locale.ads @@ -19,18 +19,34 @@ package Ada.Locales is pragma Preelaborate (Locales); pragma Remote_Types (Locales); + -- A locale identifies a geopolitical place or region and its associated + -- language, which can be used to determine other + -- internationalization-related characteristics. The active locale is the + -- locale associated with the partition of the current task. + type Language_Code is new String (1 .. 3) with Dynamic_Predicate => (for all E of Language_Code => E in 'a' .. 'z'); + -- Lower-case string representation of an ISO 639-3 alpha-3 code that + -- identifies a language. type Country_Code is new String (1 .. 2) with Dynamic_Predicate => (for all E of Country_Code => E in 'A' .. 'Z'); + -- Upper-case string representation of an ISO 3166-1 alpha-2 code that + -- identifies a country. Language_Unknown : constant Language_Code := "und"; Country_Unknown : constant Country_Code := "ZZ"; function Language return Language_Code; + -- Returns the code of the language associated with the active locale. If + -- the Language_Code associated with the active locale cannot be determined + -- from the environment, then Language returns Language_Unknown. + function Country return Country_Code; + -- Returns the code of the country associated with the active locale. If + -- the Country_Code associated with the active locale cannot be determined + -- from the environment, then Country returns Country_Unknown. end Ada.Locales;