Commit 76af4137 by Arnaud Charlet

[multiple changes]

2011-08-29  Eric Botcazou  <ebotcazou@adacore.com>

	* sem_ch13.adb (Alignment_Check_For_Esize_Change): Rename to...
	(Alignment_Check_For_Size_Change): ...this.  Add SIZE parameter and
	use it instead of the Esize of the first parameter.
	(Analyze_Attribute_Definition_Clause) <Object_Size>: Adjust call to
	above change.
	<Size>: Likewise.  Call it for composite types on the RM size.

2011-08-29  Yannick Moy  <moy@adacore.com>

	* exp_ch4.adb (Expand_N_Op_Not): Do not expand not on array.
	* sem_util.adb (Unique_Name): Correct behaviour for names of
	compilation units.

From-SVN: r178157
parent 9b20e59b
2011-08-29 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch13.adb (Alignment_Check_For_Esize_Change): Rename to...
(Alignment_Check_For_Size_Change): ...this. Add SIZE parameter and
use it instead of the Esize of the first parameter.
(Analyze_Attribute_Definition_Clause) <Object_Size>: Adjust call to
above change.
<Size>: Likewise. Call it for composite types on the RM size.
2011-08-29 Yannick Moy <moy@adacore.com>
* exp_ch4.adb (Expand_N_Op_Not): Do not expand not on array.
* sem_util.adb (Unique_Name): Correct behaviour for names of
compilation units.
2011-08-29 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Check_Precondition_Postcondition): In formal
......
......@@ -7158,9 +7158,10 @@ package body Exp_Ch4 is
end;
end if;
-- Only array types need any other processing
-- Only array types need any other processing. In formal verification
-- mode, no other processing is done.
if not Is_Array_Type (Typ) then
if not Is_Array_Type (Typ) or else ALFA_Mode then
return;
end if;
......
......@@ -73,11 +73,11 @@ package body Sem_Ch13 is
-- Local Subprograms --
-----------------------
procedure Alignment_Check_For_Esize_Change (Typ : Entity_Id);
-- This routine is called after setting the Esize of type entity Typ.
-- The purpose is to deal with the situation where an alignment has been
-- inherited from a derived type that is no longer appropriate for the
-- new Esize value. In this case, we reset the Alignment to unknown.
procedure Alignment_Check_For_Size_Change (Typ : Entity_Id; Size : Uint);
-- This routine is called after setting one of the sizes of type entity
-- Typ to Size. The purpose is to deal with the situation of a derived
-- type whose inherited alignment is no longer appropriate for the new
-- size value. In this case, we reset the Alignment to unknown.
procedure Build_Predicate_Function (Typ : Entity_Id; N : Node_Id);
-- If Typ has predicates (indicated by Has_Predicates being set for Typ,
......@@ -661,11 +661,11 @@ package body Sem_Ch13 is
end if;
end Adjust_Record_For_Reverse_Bit_Order;
--------------------------------------
-- Alignment_Check_For_Esize_Change --
--------------------------------------
-------------------------------------
-- Alignment_Check_For_Size_Change --
-------------------------------------
procedure Alignment_Check_For_Esize_Change (Typ : Entity_Id) is
procedure Alignment_Check_For_Size_Change (Typ : Entity_Id; Size : Uint) is
begin
-- If the alignment is known, and not set by a rep clause, and is
-- inconsistent with the size being set, then reset it to unknown,
......@@ -674,11 +674,11 @@ package body Sem_Ch13 is
if Known_Alignment (Typ)
and then not Has_Alignment_Clause (Typ)
and then Esize (Typ) mod (Alignment (Typ) * SSU) /= 0
and then Size mod (Alignment (Typ) * SSU) /= 0
then
Init_Alignment (Typ);
end if;
end Alignment_Check_For_Esize_Change;
end Alignment_Check_For_Size_Change;
-----------------------------------
-- Analyze_Aspect_Specifications --
......@@ -2510,7 +2510,7 @@ package body Sem_Ch13 is
Set_Esize (U_Ent, Size);
Set_Has_Object_Size_Clause (U_Ent);
Alignment_Check_For_Esize_Change (U_Ent);
Alignment_Check_For_Size_Change (U_Ent, Size);
end if;
end Object_Size;
......@@ -2603,6 +2603,9 @@ package body Sem_Ch13 is
-- (object size) unset, the back end will set it from the
-- size and alignment in an appropriate manner.
-- In both cases, we check whether the alignment must be
-- reset in the wake of the size change.
if Is_Elementary_Type (U_Ent) then
if Size <= System_Storage_Unit then
Init_Esize (U_Ent, System_Storage_Unit);
......@@ -2614,7 +2617,9 @@ package body Sem_Ch13 is
Set_Esize (U_Ent, (Size + 63) / 64 * 64);
end if;
Alignment_Check_For_Esize_Change (U_Ent);
Alignment_Check_For_Size_Change (U_Ent, Esize (U_Ent));
else
Alignment_Check_For_Size_Change (U_Ent, Size);
end if;
-- For objects, set Esize only
......
......@@ -12384,7 +12384,9 @@ package body Sem_Util is
if E = Standard_Standard then
return Get_Name_String (Name_Standard);
elsif Scope (E) = Standard_Standard then
elsif Scope (E) = Standard_Standard
and then not (Ekind (E) = E_Package or else Is_Subprogram (E))
then
return Get_Name_String (Name_Standard) & "__" &
Get_Name_String (Chars (E));
......
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