Commit 2593c3e1 by Arnaud Charlet

[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
parent 1a105488
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> 2010-01-26 Vincent Celier <celier@adacore.com>
* gnat_ugn.texi: Complete documentation on the restrictions for * gnat_ugn.texi: Complete documentation on the restrictions for
......
...@@ -568,7 +568,7 @@ package body Freeze is ...@@ -568,7 +568,7 @@ package body Freeze is
procedure Set_Small_Size (T : Entity_Id; S : Uint); procedure Set_Small_Size (T : Entity_Id; S : Uint);
-- Sets the compile time known size (32 bits or less) in the Esize -- 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 -- 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; function Size_Known (T : Entity_Id) return Boolean;
-- Recursive function that does all the work -- Recursive function that does all the work
...@@ -589,6 +589,15 @@ package body Freeze is ...@@ -589,6 +589,15 @@ package body Freeze is
if S > 32 then if S > 32 then
return; 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 elsif Has_Size_Clause (T) then
if RM_Size (T) < S then if RM_Size (T) < S then
Error_Msg_Uint_1 := S; Error_Msg_Uint_1 := S;
...@@ -890,12 +899,12 @@ package body Freeze is ...@@ -890,12 +899,12 @@ package body Freeze is
if Is_Elementary_Type (Ctyp) if Is_Elementary_Type (Ctyp)
or else (Is_Array_Type (Ctyp) or else (Is_Array_Type (Ctyp)
and then Present (Packed_Array_Type (Ctyp)) and then Present (Packed_Array_Type (Ctyp))
and then Is_Modular_Integer_Type and then Is_Modular_Integer_Type
(Packed_Array_Type (Ctyp))) (Packed_Array_Type (Ctyp)))
then then
-- If RM_Size is known and static, then we can -- If RM_Size is known and static, then we can keep
-- keep accumulating the packed size. -- accumulating the packed size.
if Known_Static_RM_Size (Ctyp) then if Known_Static_RM_Size (Ctyp) then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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 ...@@ -226,14 +226,12 @@ package body System.Tasking.Protected_Objects.Entries is
raise Program_Error; raise Program_Error;
end if; end if;
-- pragma Assert (Self_Id.Deferral_Level = 0);
-- If a PO is created from a controlled operation, abort is already -- If a PO is created from a controlled operation, abort is already
-- deferred at this point, so we need to use Defer_Abort_Nestable -- 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 -- inconsistencies, outside the above scenario involving controlled
-- types: -- types.
-- pragma Assert (Self_Id.Deferral_Level = 0);
-- Why is this commented out Assert here ???
Initialization.Defer_Abort_Nestable (Self_ID); Initialization.Defer_Abort_Nestable (Self_ID);
Initialize_Lock (Init_Priority, Object.L'Access); Initialize_Lock (Init_Priority, Object.L'Access);
......
...@@ -160,7 +160,12 @@ package SCOs is ...@@ -160,7 +160,12 @@ package SCOs is
-- Decisions -- Decisions
-- Note: in the following description, logical operator includes only the -- 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 -- Decisions are either simple or complex. A simple decision is a boolean
-- expresssion that occurs in the context of a control structure in the -- expresssion that occurs in the context of a control structure in the
...@@ -217,7 +222,7 @@ package SCOs is ...@@ -217,7 +222,7 @@ package SCOs is
-- expression ::= !sloc term (if expr is NOT) -- expression ::= !sloc term (if expr is NOT)
-- In the last four cases, sloc is the source location of the AND, OR, -- 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 ::= element
-- term ::= expression -- term ::= expression
...@@ -296,7 +301,7 @@ package SCOs is ...@@ -296,7 +301,7 @@ package SCOs is
-- Operator -- Operator
-- C1 = '!', '^', '&', '|' -- C1 = '!', '^', '&', '|'
-- C2 = ' ' -- C2 = ' '
-- From = location of NOT/XOR/AND/OR token -- From = location of NOT/AND/OR token
-- To = No_Source_Location -- To = No_Source_Location
-- Last = False -- Last = False
......
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