procedure Convert_To_Positional
(N : Node_Id;
- Max_Others_Replicate : Nat := 5;
+ Max_Others_Replicate : Nat := 32;
Handle_Bit_Packed : Boolean := False);
-- If possible, convert named notation to positional notation. This
-- conversion is possible only in some static cases. If the conversion is
-- possible, then N is rewritten with the analyzed converted aggregate.
-- The parameter Max_Others_Replicate controls the maximum number of
-- values corresponding to an others choice that will be converted to
- -- positional notation (the default of 5 is the normal limit, and reflects
+ -- positional notation (the default of 32 is the normal limit, and reflects
-- the fact that normally the loop is better than a lot of separate
-- assignments). Note that this limit gets overridden in any case if
-- either of the restrictions No_Elaboration_Code or No_Implicit_Loops is
-- Packed_Array_Aggregate_Handled, we set this parameter to True, since
-- these are cases we handle in there.
- -- It would seem useful to have a higher default for Max_Others_Replicate,
- -- but aggregates in the compiler make this impossible: the compiler
- -- bootstrap fails if Max_Others_Replicate is greater than 25. This
- -- is unexpected ???
-
procedure Expand_Array_Aggregate (N : Node_Id);
-- This is the top-level routine to perform array aggregate expansion.
-- N is the N_Aggregate node to be expanded.
procedure Convert_To_Positional
(N : Node_Id;
- Max_Others_Replicate : Nat := 5;
+ Max_Others_Replicate : Nat := 32;
Handle_Bit_Packed : Boolean := False)
is
Typ : constant Entity_Id := Etype (N);
-- from the disk and then cached in the File_Attributes parameter (possibly
-- along with other values).
- type File_Attributes is private;
- Unknown_Attributes : constant File_Attributes;
+ File_Attributes_Size : constant Natural := 32;
+ -- This should be big enough to fit a "struct file_attributes" on any
+ -- system. It doesn't cause any malfunction if it is too big (which avoids
+ -- the need for either mapping the struct exactly or importing the sizeof
+ -- from C, which would result in dynamic code). However, it does waste
+ -- space (e.g. when a component of this type appears in a record, if it is
+ -- unnecessarily large). Note: for runtime units, use System.OS_Constants.
+ -- SIZEOF_struct_file_attributes instead, which has the exact value.
+
+ type File_Attributes is
+ array (1 .. File_Attributes_Size)
+ of System.Storage_Elements.Storage_Element;
+ for File_Attributes'Alignment use Standard'Maximum_Alignment;
+
+ Unknown_Attributes : File_Attributes;
-- A cache for various attributes for a file (length, accessibility,...)
- -- This must be initialized to Unknown_Attributes prior to the first call.
+ -- Will be initialized properly at elaboration (for efficiency later on,
+ -- avoid function calls every time we want to reset the attributes) prior
+ -- to the first usage. We cannot make it constant since the compiler may
+ -- put it in a read-only section.
function Is_Directory
(Name : C_File_Name;
-- detected, the file being written is deleted, and a fatal error is
-- signalled.
- File_Attributes_Size : constant Natural := 32;
- -- This should be big enough to fit a "struct file_attributes" on any
- -- system. It doesn't cause any malfunction if it is too big (which avoids
- -- the need for either mapping the struct exactly or importing the sizeof
- -- from C, which would result in dynamic code). However, it does waste
- -- space (e.g. when a component of this type appears in a record, if it is
- -- unnecessarily large). Note: for runtime units, use System.OS_Constants.
- -- SIZEOF_struct_file_attributes instead, which has the exact value.
-
- type File_Attributes is
- array (1 .. File_Attributes_Size)
- of System.Storage_Elements.Storage_Element;
- for File_Attributes'Alignment use Standard'Maximum_Alignment;
-
- Unknown_Attributes : constant File_Attributes := (others => 0);
- -- Will be initialized properly at elaboration (for efficiency later on,
- -- avoid function calls every time we want to reset the attributes).
-
end Osint;