From f8c6086ba8474e5997bec4d1f9c44e1ee6a7d601 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 23 Jul 2009 12:03:21 +0200 Subject: [PATCH] [multiple changes] 2009-07-23 Arnaud Charlet * a-convec.adb: Add comments about suspicious/subtle code. 2009-07-23 Ed Schonberg * einfo.ads: Document use of Alias in private overriding 2009-07-23 Thomas Quinot * 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 From-SVN: r149991 --- gcc/ada/ChangeLog | 19 +++++++++++++++++++ gcc/ada/a-convec.adb | 7 ++++++- gcc/ada/einfo.ads | 7 ++++++- gcc/ada/g-comlin.ads | 32 ++++++++++++++++---------------- gcc/ada/lib-writ.ads | 12 ++++++------ gcc/ada/scos.ads | 11 +++++++---- gcc/ada/sem_ch13.adb | 13 +++++++++++-- 7 files changed, 71 insertions(+), 30 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2e160cde551..c07e7190aee 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,22 @@ +2009-07-23 Arnaud Charlet + + * a-convec.adb: Add comments about suspicious/subtle code. + +2009-07-23 Ed Schonberg + + * einfo.ads: Document use of Alias in private overriding + +2009-07-23 Thomas Quinot + + * 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 * exp_ch3.adb (Expand_N_Object_Declaration): For an initialized object diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index b876e8ee971..64b1b07d927 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -267,10 +267,15 @@ package body Ada.Containers.Vectors is begin Container.Elements := null; - Container.Last := No_Index; 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; diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 150f18dd82b..79f86863783 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -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. --- 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 diff --git a/gcc/ada/g-comlin.ads b/gcc/ada/g-comlin.ads index 57a68c2ab2f..5e8f63f420c 100644 --- a/gcc/ada/g-comlin.ads +++ b/gcc/ada/g-comlin.ads @@ -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 --- 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 @@ -136,14 +136,14 @@ -- 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 @@ -157,7 +157,7 @@ -- * 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; @@ -212,12 +212,12 @@ -- 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; @@ -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 - -- 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 diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads index 5a15fd302df..d5236773a3d 100644 --- a/gcc/ada/lib-writ.ads +++ b/gcc/ada/lib-writ.ads @@ -344,9 +344,9 @@ package Lib.Writ is -- 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 @@ -363,9 +363,9 @@ package Lib.Writ is -- 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 diff --git a/gcc/ada/scos.ads b/gcc/ada/scos.ads index b1d99e169fa..fa039a5f5fe 100644 --- a/gcc/ada/scos.ads +++ b/gcc/ada/scos.ads @@ -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). + -- 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 @@ -253,15 +256,15 @@ package SCOs is -- 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 = ' ' - -- From = No_Location - -- To = No_Location + -- From = No_Source_Location + -- To = No_Source_Location -- Last = False -- Element diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 89ad8454c13..a2156b38cd4 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1059,7 +1059,7 @@ package body Sem_Ch13 is -- Alignment attribute definition clause - when Attribute_Alignment => Alignment_Block : declare + when Attribute_Alignment => Alignment : declare 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); + + -- 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 Alignment_Block; + end Alignment; --------------- -- Bit_Order --