OSDN Git Service

2009-07-23 Arnaud Charlet <charlet@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Jul 2009 10:03:21 +0000 (10:03 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Jul 2009 10:03:21 +0000 (10:03 +0000)
* a-convec.adb: Add comments about suspicious/subtle code.

2009-07-23  Ed Schonberg  <schonberg@adacore.com>

* einfo.ads: Document use of Alias in private overriding

2009-07-23  Thomas Quinot  <quinot@adacore.com>

* sem_ch13.adb (Analyze_Attribute_Definition_Clause): For the case of
an array type, propagate alignment from first subtype to implicit base
type so that other subtypes (such as the itypes for aggregates of the
type) also receive the expected alignment.

* g-comlin.ads: Minor documentation clarification/rewording.
* scos.ads: Minor comments update.
* lib-writ.ads: Minor reformatting

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149991 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/a-convec.adb
gcc/ada/einfo.ads
gcc/ada/g-comlin.ads
gcc/ada/lib-writ.ads
gcc/ada/scos.ads
gcc/ada/sem_ch13.adb

index 2e160cd..c07e719 100644 (file)
@@ -1,3 +1,22 @@
+2009-07-23  Arnaud Charlet  <charlet@adacore.com>
+
+       * a-convec.adb: Add comments about suspicious/subtle code.
+
+2009-07-23  Ed Schonberg  <schonberg@adacore.com>
+
+       * einfo.ads: Document use of Alias in private overriding
+
+2009-07-23  Thomas Quinot  <quinot@adacore.com>
+
+       * sem_ch13.adb (Analyze_Attribute_Definition_Clause): For the case of
+       an array type, propagate alignment from first subtype to implicit base
+       type so that other subtypes (such as the itypes for aggregates of the
+       type) also receive the expected alignment.
+
+       * g-comlin.ads: Minor documentation clarification/rewording. 
+       * scos.ads: Minor comments update.
+       * lib-writ.ads: Minor reformatting
+
 2009-07-23  Gary Dismukes  <dismukes@adacore.com>
 
        * exp_ch3.adb (Expand_N_Object_Declaration): For an initialized object
 2009-07-23  Gary Dismukes  <dismukes@adacore.com>
 
        * exp_ch3.adb (Expand_N_Object_Declaration): For an initialized object
index b876e8e..64b1b07 100644 (file)
@@ -267,10 +267,15 @@ package body Ada.Containers.Vectors is
 
       begin
          Container.Elements := null;
 
       begin
          Container.Elements := null;
-         Container.Last := No_Index;
          Container.Busy := 0;
          Container.Lock := 0;
 
          Container.Busy := 0;
          Container.Lock := 0;
 
+         --  Note: it may seem that the following assignment to Container.Last
+         --  is useless, since we assign it to L below. However this code is
+         --  used in case 'new Elements_Type' below raises an exception, to
+         --  keep Container in a consistent state.
+
+         Container.Last := No_Index;
          Container.Elements := new Elements_Type'(L, EA);
          Container.Last := L;
       end;
          Container.Elements := new Elements_Type'(L, EA);
          Container.Last := L;
       end;
index 150f18d..79f8686 100644 (file)
@@ -358,7 +358,12 @@ package Einfo is
 --       subprogram. In case of abstract interface subprograms it points to the
 --       subprogram that covers the abstract interface primitive. Also used for
 --       a subprogram renaming, where it points to the renamed subprogram.
 --       subprogram. In case of abstract interface subprograms it points to the
 --       subprogram that covers the abstract interface primitive. Also used for
 --       a subprogram renaming, where it points to the renamed subprogram.
---       Always empty for entries.
+--       For an inherited operation (of a type extension) that is overridden
+--       in a private part, the Alias is the overriding operation. In this
+--       fashion a call from outside the package ends up executing the new body
+--       even if non-dispatching, and a call from inside calls the overriding
+--       operation because it hides the implicit one.
+--       Alias is always empty for entries.
 
 --    Alignment (Uint14)
 --       Present in entities for types and also in constants, variables
 
 --    Alignment (Uint14)
 --       Present in entities for types and also in constants, variables
index 57a68c2..5e8f63f 100644 (file)
@@ -84,7 +84,7 @@
 --  A more complicated example would involve the use of sections for the
 --  switches, as for instance in gnatmake. The same command line is used to
 --  provide switches for several tools. Each tool recognizes its switches by
 --  A more complicated example would involve the use of sections for the
 --  switches, as for instance in gnatmake. The same command line is used to
 --  provide switches for several tools. Each tool recognizes its switches by
---  separating them with special switches, chosen by the programmer.
+--  separating them with special switches that act as section separators.
 --  Each section acts as a command line of its own.
 
 --  begin
 --  Each section acts as a command line of its own.
 
 --  begin
 --  Creating and manipulating the command line
 --  ===========================================
 
 --  Creating and manipulating the command line
 --  ===========================================
 
---  This package provides handling of command line by providing methods to
---  add or remove arguments from it. The resulting command line is kept as
---  short as possible by coalescing arguments whenever possible.
+--  This package provides mechanisms to create and modify command lines by
+--  adding or removing arguments from them. The resulting command line is kept
+--  as short as possible by coalescing arguments whenever possible.
 
 
---  This package can be used to construct complex command lines for instance
---  from an GUI interface (although the package itself does not depend on a
---  specific GUI toolkit). For instance, if you are configuring the command
---  line to use when spawning a tool with the following characteristics:
+--  Complex command lines can thus be constructed, for example from an GUI
+--  (although this package does not by itself depend upon any specific GUI
+--  toolkit). For instance, if you are configuring the command line to use
+--  when spawning a tool with the following characteristics:
 
 --    * Specifying -gnatwa is the same as specifying -gnatwu -gnatwv, but
 --      shorter and more readable
 
 --    * Specifying -gnatwa is the same as specifying -gnatwu -gnatwv, but
 --      shorter and more readable
 
 --    * A switch -foo takes one mandatory parameter
 
 
 --    * A switch -foo takes one mandatory parameter
 
---  These attributes can be configured through this package with the following
+--  These properties can be configured through this package with the following
 --  calls:
 
 --     Config : Command_Line_Configuration;
 --  calls:
 
 --     Config : Command_Line_Configuration;
 --  Parsing the command line with grouped arguments
 --  ===============================================
 
 --  Parsing the command line with grouped arguments
 --  ===============================================
 
---  This package also works great in collaboration with GNAT.Command_Line, to
---  parse the input to your tools. If you are writing the tool we described
---  above, you would do a first loop with Getopt to pass the switches and
---  their arguments, and create a temporary representation of the command line
---  as a Command_Line object. Finally, you can ask each individual switch to
---  that object. For instance:
+--  The command line construction facility can also be used in conjunction with
+--  Getopt to interpret a command line. For example when implementing the tool
+--  described above, you would do a first loop with Getopt to pass the switches
+--  and their arguments, and create a temporary representation of the command
+--  line as a Command_Line object. Finally, you can query each individual
+--  switch from that object. For instance:
 
 --    declare
 --      Cmd  : Command_Line;
 
 --    declare
 --      Cmd  : Command_Line;
@@ -338,7 +338,7 @@ package GNAT.Command_Line is
    --  that is located. If there are no more switches in the current section,
    --  returns ASCII.NUL. If Concatenate is True (by default), the switches
    --  does not need to be separated by spaces (they can be concatenated if
    --  that is located. If there are no more switches in the current section,
    --  returns ASCII.NUL. If Concatenate is True (by default), the switches
    --  does not need to be separated by spaces (they can be concatenated if
-   --  they do not require an argument, e.g. -ab is the ame as two separate
+   --  they do not require an argument, e.g. -ab is the same as two separate
    --  arguments -a -b).
    --
    --  Switches is a string of all the possible switches, separated by a
    --  arguments -a -b).
    --
    --  Switches is a string of all the possible switches, separated by a
index 5a15fd3..d523677 100644 (file)
@@ -344,9 +344,9 @@ package Lib.Writ is
    --      name are separated by periods. The names themselves are in encoded
    --      form, as documented in Namet.
 
    --      name are separated by periods. The names themselves are in encoded
    --      form, as documented in Namet.
 
-   --  ------------------------
-   --  -- I Interrupt States --
-   --  ------------------------
+   --  -------------------------
+   --  -- I  Interrupt States --
+   --  -------------------------
 
    --    I interrupt-number interrupt-state line-number
 
 
    --    I interrupt-number interrupt-state line-number
 
@@ -363,9 +363,9 @@ package Lib.Writ is
    --      number of the corresponding Interrupt_State pragma. This is used
    --      in consistency messages.
 
    --      number of the corresponding Interrupt_State pragma. This is used
    --      in consistency messages.
 
-   --  -------------------------------------
-   --  -- S Priority Specific Dispatching --
-   --  -------------------------------------
+   --  --------------------------------------
+   --  -- S  Priority Specific Dispatching --
+   --  --------------------------------------
 
    --    S policy_identifier first_priority last_priority line-number
 
 
    --    S policy_identifier first_priority last_priority line-number
 
index b1d99e1..fa039a5 100644 (file)
@@ -86,6 +86,9 @@ package SCOs is
    --        a Source_Reference pragma was encountered (since all line number
    --        references will be with respect to the original file).
 
    --        a Source_Reference pragma was encountered (since all line number
    --        references will be with respect to the original file).
 
+   --        Isn't the filename indication redundant, since we can look it up
+   --        from the D line???
+
    --  Statements
 
    --    For the purpose of SCO generation, the notion of statement includes
    --  Statements
 
    --    For the purpose of SCO generation, the notion of statement includes
@@ -253,15 +256,15 @@ package SCOs is
    --    Complex Decision
    --      C1   = 'I', 'E', 'W', 'X' (if/exit/while/expression)
    --      C2   = ' '
    --    Complex Decision
    --      C1   = 'I', 'E', 'W', 'X' (if/exit/while/expression)
    --      C2   = ' '
-   --      From = No_Location
-   --      To   = No_Location
+   --      From = No_Source_Location
+   --      To   = No_Source_Location
    --      Last = False
 
    --    Operator
    --      C1   = '!', '^', '&', '|'
    --      C2   = ' '
    --      Last = False
 
    --    Operator
    --      C1   = '!', '^', '&', '|'
    --      C2   = ' '
-   --      From = No_Location
-   --      To   = No_Location
+   --      From = No_Source_Location
+   --      To   = No_Source_Location
    --      Last = False
 
    --    Element
    --      Last = False
 
    --    Element
index 89ad845..a2156b3 100644 (file)
@@ -1059,7 +1059,7 @@ package body Sem_Ch13 is
 
          --  Alignment attribute definition clause
 
 
          --  Alignment attribute definition clause
 
-         when Attribute_Alignment => Alignment_Block : declare
+         when Attribute_Alignment => Alignment : declare
             Align : constant Uint := Get_Alignment_Value (Expr);
 
          begin
             Align : constant Uint := Get_Alignment_Value (Expr);
 
          begin
@@ -1078,8 +1078,17 @@ package body Sem_Ch13 is
             elsif Align /= No_Uint then
                Set_Has_Alignment_Clause (U_Ent);
                Set_Alignment            (U_Ent, Align);
             elsif Align /= No_Uint then
                Set_Has_Alignment_Clause (U_Ent);
                Set_Alignment            (U_Ent, Align);
+
+               --  For an array type, U_Ent is the first subtype. In that case,
+               --  also set the alignment of the anonymous base type so that
+               --  other subtypes (such as the itypes for aggregates of the
+               --  type) also receive the expected alignment.
+
+               if Is_Array_Type (U_Ent) then
+                  Set_Alignment (Base_Type (U_Ent), Align);
+               end if;
             end if;
             end if;
-         end Alignment_Block;
+         end Alignment;
 
          ---------------
          -- Bit_Order --
 
          ---------------
          -- Bit_Order --