[multiple changes]

2010-01-26  Arnaud Charlet  <charlet@adacore.com>

	* s-tpoben.adb: Update comments.

2010-01-26  Robert Dewar  <dewar@adacore.com>

	* freeze.adb (Set_Small_Size): Don't set size if alignment clause
	present.

2010-01-26  Robert Dewar  <dewar@adacore.com>

	* scos.ads: Clean up documentation, remove obsolete XOR references

From-SVN: r156238
This commit is contained in:
Arnaud Charlet 2010-01-26 11:02:11 +01:00
parent 1a1054884e
commit 2593c3e1cb
4 changed files with 39 additions and 15 deletions

View File

@ -1,3 +1,15 @@
2010-01-26 Arnaud Charlet <charlet@adacore.com>
* s-tpoben.adb: Update comments.
2010-01-26 Robert Dewar <dewar@adacore.com>
* freeze.adb (Set_Small_Size): Don't set size if alignment clause
present.
2010-01-26 Robert Dewar <dewar@adacore.com>
* scos.ads: Clean up documentation, remove obsolete XOR references
2010-01-26 Vincent Celier <celier@adacore.com>
* gnat_ugn.texi: Complete documentation on the restrictions for

View File

@ -568,7 +568,7 @@ package body Freeze is
procedure Set_Small_Size (T : Entity_Id; S : Uint);
-- Sets the compile time known size (32 bits or less) in the Esize
-- field, of T checking for a size clause that was given which attempts
-- to give a smaller size.
-- to give a smaller size, and also checking for an alignment clause.
function Size_Known (T : Entity_Id) return Boolean;
-- Recursive function that does all the work
@ -589,6 +589,15 @@ package body Freeze is
if S > 32 then
return;
-- Don't bother if alignment clause with a value other than 1 is
-- present, because size may be padded up to meet back end alignment
-- requirements, and only the back end knows the rules!
elsif Known_Alignment (T) and then Alignment (T) /= 1 then
return;
-- Check for bad size clause given
elsif Has_Size_Clause (T) then
if RM_Size (T) < S then
Error_Msg_Uint_1 := S;
@ -890,12 +899,12 @@ package body Freeze is
if Is_Elementary_Type (Ctyp)
or else (Is_Array_Type (Ctyp)
and then Present (Packed_Array_Type (Ctyp))
and then Is_Modular_Integer_Type
(Packed_Array_Type (Ctyp)))
and then Present (Packed_Array_Type (Ctyp))
and then Is_Modular_Integer_Type
(Packed_Array_Type (Ctyp)))
then
-- If RM_Size is known and static, then we can
-- keep accumulating the packed size.
-- If RM_Size is known and static, then we can keep
-- accumulating the packed size.
if Known_Static_RM_Size (Ctyp) then

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
-- Copyright (C) 1998-2010, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -226,14 +226,12 @@ package body System.Tasking.Protected_Objects.Entries is
raise Program_Error;
end if;
-- pragma Assert (Self_Id.Deferral_Level = 0);
-- If a PO is created from a controlled operation, abort is already
-- deferred at this point, so we need to use Defer_Abort_Nestable
-- In some cases, the below assertion can be useful to spot
-- In some cases, the above assertion can be useful to spot
-- inconsistencies, outside the above scenario involving controlled
-- types:
-- pragma Assert (Self_Id.Deferral_Level = 0);
-- Why is this commented out Assert here ???
-- types.
Initialization.Defer_Abort_Nestable (Self_ID);
Initialize_Lock (Init_Priority, Object.L'Access);

View File

@ -160,7 +160,12 @@ package SCOs is
-- Decisions
-- Note: in the following description, logical operator includes only the
-- short circuited forms (so can be only of NOT, AND THEN, or OR ELSE).
-- short circuited forms and NOT (so can be only NOT, AND THEN, OR ELSE).
-- The reason that we can exclude AND/OR/XOR is that we expect SCO's to
-- be generated using the restriction No_Direct_Boolean_Operators, which
-- does not permit the use of AND/OR/XOR on boolean operands. These are
-- permitted on modular integer types, but such operations do not count
-- as decisions in any case
-- Decisions are either simple or complex. A simple decision is a boolean
-- expresssion that occurs in the context of a control structure in the
@ -217,7 +222,7 @@ package SCOs is
-- expression ::= !sloc term (if expr is NOT)
-- In the last four cases, sloc is the source location of the AND, OR,
-- XOR or NOT token, respectively.
-- or NOT token, respectively.
-- term ::= element
-- term ::= expression
@ -296,7 +301,7 @@ package SCOs is
-- Operator
-- C1 = '!', '^', '&', '|'
-- C2 = ' '
-- From = location of NOT/XOR/AND/OR token
-- From = location of NOT/AND/OR token
-- To = No_Source_Location
-- Last = False