Commit f8c6086b by Arnaud Charlet

[multiple changes]

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

From-SVN: r149991
parent dfcfdc0a
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> 2009-07-23 Gary Dismukes <dismukes@adacore.com>
* exp_ch3.adb (Expand_N_Object_Declaration): For an initialized object * exp_ch3.adb (Expand_N_Object_Declaration): For an initialized object
......
...@@ -267,10 +267,15 @@ package body Ada.Containers.Vectors is ...@@ -267,10 +267,15 @@ package body Ada.Containers.Vectors is
begin begin
Container.Elements := null; Container.Elements := null;
Container.Last := No_Index;
Container.Busy := 0; Container.Busy := 0;
Container.Lock := 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.Elements := new Elements_Type'(L, EA);
Container.Last := L; Container.Last := L;
end; end;
......
...@@ -358,7 +358,12 @@ package Einfo is ...@@ -358,7 +358,12 @@ package Einfo is
-- subprogram. In case of abstract interface subprograms it points to the -- subprogram. In case of abstract interface subprograms it points to the
-- subprogram that covers the abstract interface primitive. Also used for -- subprogram that covers the abstract interface primitive. Also used for
-- a subprogram renaming, where it points to the renamed subprogram. -- 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) -- Alignment (Uint14)
-- Present in entities for types and also in constants, variables -- Present in entities for types and also in constants, variables
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
-- A more complicated example would involve the use of sections for the -- 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 -- switches, as for instance in gnatmake. The same command line is used to
-- provide switches for several tools. Each tool recognizes its switches by -- 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. -- Each section acts as a command line of its own.
-- begin -- begin
...@@ -136,14 +136,14 @@ ...@@ -136,14 +136,14 @@
-- Creating and manipulating the command line -- Creating and manipulating the command line
-- =========================================== -- ===========================================
-- This package provides handling of command line by providing methods to -- This package provides mechanisms to create and modify command lines by
-- add or remove arguments from it. The resulting command line is kept as -- adding or removing arguments from them. The resulting command line is kept
-- short as possible by coalescing arguments whenever possible. -- as short as possible by coalescing arguments whenever possible.
-- This package can be used to construct complex command lines for instance -- Complex command lines can thus be constructed, for example from an GUI
-- from an GUI interface (although the package itself does not depend on a -- (although this package does not by itself depend upon any specific GUI
-- specific GUI toolkit). For instance, if you are configuring the command -- toolkit). For instance, if you are configuring the command line to use
-- line to use when spawning a tool with the following characteristics: -- when spawning a tool with the following characteristics:
-- * Specifying -gnatwa is the same as specifying -gnatwu -gnatwv, but -- * Specifying -gnatwa is the same as specifying -gnatwu -gnatwv, but
-- shorter and more readable -- shorter and more readable
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
-- * 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: -- calls:
-- Config : Command_Line_Configuration; -- Config : Command_Line_Configuration;
...@@ -212,12 +212,12 @@ ...@@ -212,12 +212,12 @@
-- 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 -- The command line construction facility can also be used in conjunction with
-- parse the input to your tools. If you are writing the tool we described -- Getopt to interpret a command line. For example when implementing the tool
-- above, you would do a first loop with Getopt to pass the switches and -- described above, you would do a first loop with Getopt to pass the switches
-- their arguments, and create a temporary representation of the command line -- and their arguments, and create a temporary representation of the command
-- as a Command_Line object. Finally, you can ask each individual switch to -- line as a Command_Line object. Finally, you can query each individual
-- that object. For instance: -- switch from that object. For instance:
-- declare -- declare
-- Cmd : Command_Line; -- Cmd : Command_Line;
...@@ -338,7 +338,7 @@ package GNAT.Command_Line is ...@@ -338,7 +338,7 @@ package GNAT.Command_Line is
-- that is located. If there are no more switches in the current section, -- that is located. If there are no more switches in the current section,
-- returns ASCII.NUL. If Concatenate is True (by default), the switches -- returns ASCII.NUL. If Concatenate is True (by default), the switches
-- does not need to be separated by spaces (they can be concatenated if -- 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). -- arguments -a -b).
-- --
-- Switches is a string of all the possible switches, separated by a -- Switches is a string of all the possible switches, separated by a
......
...@@ -344,9 +344,9 @@ package Lib.Writ is ...@@ -344,9 +344,9 @@ package Lib.Writ is
-- name are separated by periods. The names themselves are in encoded -- name are separated by periods. The names themselves are in encoded
-- form, as documented in Namet. -- 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 ...@@ -363,9 +363,9 @@ package Lib.Writ is
-- number of the corresponding Interrupt_State pragma. This is used -- number of the corresponding Interrupt_State pragma. This is used
-- in consistency messages. -- 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
......
...@@ -86,6 +86,9 @@ package SCOs is ...@@ -86,6 +86,9 @@ package SCOs is
-- a Source_Reference pragma was encountered (since all line number -- a Source_Reference pragma was encountered (since all line number
-- references will be with respect to the original file). -- 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 -- Statements
-- For the purpose of SCO generation, the notion of statement includes -- For the purpose of SCO generation, the notion of statement includes
...@@ -253,15 +256,15 @@ package SCOs is ...@@ -253,15 +256,15 @@ package SCOs is
-- Complex Decision -- Complex Decision
-- C1 = 'I', 'E', 'W', 'X' (if/exit/while/expression) -- C1 = 'I', 'E', 'W', 'X' (if/exit/while/expression)
-- C2 = ' ' -- C2 = ' '
-- From = No_Location -- From = No_Source_Location
-- To = No_Location -- To = No_Source_Location
-- Last = False -- Last = False
-- Operator -- Operator
-- C1 = '!', '^', '&', '|' -- C1 = '!', '^', '&', '|'
-- C2 = ' ' -- C2 = ' '
-- From = No_Location -- From = No_Source_Location
-- To = No_Location -- To = No_Source_Location
-- Last = False -- Last = False
-- Element -- Element
......
...@@ -1059,7 +1059,7 @@ package body Sem_Ch13 is ...@@ -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); Align : constant Uint := Get_Alignment_Value (Expr);
begin begin
...@@ -1078,8 +1078,17 @@ package body Sem_Ch13 is ...@@ -1078,8 +1078,17 @@ package body Sem_Ch13 is
elsif Align /= No_Uint then elsif Align /= No_Uint then
Set_Has_Alignment_Clause (U_Ent); Set_Has_Alignment_Clause (U_Ent);
Set_Alignment (U_Ent, Align); 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 --
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment