-- 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;
begin
Act_ST := Underlying_Type (Etype (Aexp));
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
-- considers the two types equivalent in any case.
- -- This is not strictly the case ??? If the reference is an actual
- -- in a call, the expansion of the prefix is delayed, and must be
- -- reanalyzed, see Reset_Packed_Prefix. On the other hand, if the
- -- prefix is a simple array reference, reanalysis can produce spurious
- -- type errors when the PAT type is replaced again with the original
- -- type of the array. The following is correct and minimal, but the
- -- handling of more complex packed expressions in actuals is confused.
- -- It is likely that the problem only remains for actuals in calls.
+ -- This is not strictly the case ??? If the reference is an actual in
+ -- call, the expansion of the prefix is delayed, and must be reanalyzed,
+ -- see Reset_Packed_Prefix. On the other hand, if the prefix is a simple
+ -- array reference, reanalysis can produce spurious type errors when the
+ -- PAT type is replaced again with the original type of the array. Same
+ -- for the case of a dereference. The following is correct and minimal,
+ -- but the handling of more complex packed expressions in actuals is
+ -- confused. Probably the problem only remains for actuals in calls.
Set_Etype (Aexp, Packed_Array_Type (Act_ST));
or else
(Nkind (Aexp) = N_Indexed_Component
and then Is_Entity_Name (Prefix (Aexp)))
+ or else Nkind (Aexp) = N_Explicit_Dereference
then
Set_Analyzed (Aexp);
end if;
Csiz := Component_Size (Atyp);
Convert_To_PAT_Type (Obj);
- PAT := Etype (Obj);
+ PAT := Etype (Obj);
Cmask := 2 ** Csiz - 1;
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Expand_Packed_Element_Reference (N : Node_Id);
-- 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
- -- evaluation case not the assignment case, since the result is not a
- -- variable. See Expand_Bit_Packed_Element_Set for how he assignment case
+ -- evaluation case, not the assignment case, since the result is not a
+ -- 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
-- of this call is always a variable, so the call can be used for both the
-- expression evaluation and assignment cases.