Commit f55cfa2e by Thomas Quinot Committed by Arnaud Charlet

exp_pakd.ads: Fix typos in comments.

2006-02-13  Thomas Quinot  <quinot@adacore.com>

	* exp_pakd.ads: Fix typos in comments.

	* exp_pakd.adb (Convert_To_PAT_Type): For the case of a bit packed
	array reference that is an explicit dereference, mark the converted
	(packed) array reference as analyzed to prevent a forthcoming
	reanalysis from resetting its type to the original (non-packed) array
	type.

From-SVN: r111068
parent dad9a816
...@@ -674,7 +674,7 @@ package body Exp_Pakd is ...@@ -674,7 +674,7 @@ package body Exp_Pakd is
-- The PAT is always obtained from the actual subtype -- The PAT is always obtained from the actual subtype
procedure Convert_To_PAT_Type (Aexp : Entity_Id) is procedure Convert_To_PAT_Type (Aexp : Node_Id) is
Act_ST : Entity_Id; Act_ST : Entity_Id;
begin begin
...@@ -682,18 +682,18 @@ package body Exp_Pakd is ...@@ -682,18 +682,18 @@ package body Exp_Pakd is
Act_ST := Underlying_Type (Etype (Aexp)); Act_ST := Underlying_Type (Etype (Aexp));
Create_Packed_Array_Type (Act_ST); Create_Packed_Array_Type (Act_ST);
-- Just replace the etype with the packed array type. This works -- Just replace the eEype with the packed array type. This works
-- because the expression will not be further analyzed, and Gigi -- because the expression will not be further analyzed, and Gigi
-- considers the two types equivalent in any case. -- considers the two types equivalent in any case.
-- This is not strictly the case ??? If the reference is an actual -- This is not strictly the case ??? If the reference is an actual in
-- in a call, the expansion of the prefix is delayed, and must be -- call, the expansion of the prefix is delayed, and must be reanalyzed,
-- reanalyzed, see Reset_Packed_Prefix. On the other hand, if the -- see Reset_Packed_Prefix. On the other hand, if the prefix is a simple
-- prefix is a simple array reference, reanalysis can produce spurious -- array reference, reanalysis can produce spurious type errors when the
-- type errors when the PAT type is replaced again with the original -- PAT type is replaced again with the original type of the array. Same
-- type of the array. The following is correct and minimal, but the -- for the case of a dereference. The following is correct and minimal,
-- handling of more complex packed expressions in actuals is confused. -- but the handling of more complex packed expressions in actuals is
-- It is likely that the problem only remains for actuals in calls. -- confused. Probably the problem only remains for actuals in calls.
Set_Etype (Aexp, Packed_Array_Type (Act_ST)); Set_Etype (Aexp, Packed_Array_Type (Act_ST));
...@@ -701,6 +701,7 @@ package body Exp_Pakd is ...@@ -701,6 +701,7 @@ package body Exp_Pakd is
or else or else
(Nkind (Aexp) = N_Indexed_Component (Nkind (Aexp) = N_Indexed_Component
and then Is_Entity_Name (Prefix (Aexp))) and then Is_Entity_Name (Prefix (Aexp)))
or else Nkind (Aexp) = N_Explicit_Dereference
then then
Set_Analyzed (Aexp); Set_Analyzed (Aexp);
end if; end if;
...@@ -2584,7 +2585,7 @@ package body Exp_Pakd is ...@@ -2584,7 +2585,7 @@ package body Exp_Pakd is
Csiz := Component_Size (Atyp); Csiz := Component_Size (Atyp);
Convert_To_PAT_Type (Obj); Convert_To_PAT_Type (Obj);
PAT := Etype (Obj); PAT := Etype (Obj);
Cmask := 2 ** Csiz - 1; Cmask := 2 ** Csiz - 1;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT 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- --
...@@ -237,8 +237,8 @@ package Exp_Pakd is ...@@ -237,8 +237,8 @@ package Exp_Pakd is
procedure Expand_Packed_Element_Reference (N : Node_Id); procedure Expand_Packed_Element_Reference (N : Node_Id);
-- N is an N_Indexed_Component node whose prefix is a packed array. In -- N is an N_Indexed_Component node whose prefix is a packed array. In
-- the bit packed case, this routine can only be used for the expression -- the bit packed case, this routine can only be used for the expression
-- evaluation case not the assignment case, since the result is not a -- evaluation case, not the assignment case, since the result is not a
-- variable. See Expand_Bit_Packed_Element_Set for how he assignment case -- variable. See Expand_Bit_Packed_Element_Set for how the assignment case
-- is handled in the bit packed case. For the enumeration case, the result -- is handled in the bit packed case. For the enumeration case, the result
-- of this call is always a variable, so the call can be used for both the -- of this call is always a variable, so the call can be used for both the
-- expression evaluation and assignment cases. -- expression evaluation and assignment cases.
......
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