end if;
end Matching_Standard_Type;
- -----------------------------
- -- May_Generate_Large_Temp --
- -----------------------------
-
- -- At the current time, the only types that we return False for (i.e. where
- -- we decide we know they cannot generate large temps) are ones where we
- -- know the size is 256 bits or less at compile time, and we are still not
- -- doing a thorough job on arrays and records.
-
- function May_Generate_Large_Temp (Typ : Entity_Id) return Boolean is
- begin
- if not Size_Known_At_Compile_Time (Typ) then
- return False;
- end if;
-
- if Known_Esize (Typ) and then Esize (Typ) <= 256 then
- return False;
- end if;
-
- if Is_Array_Type (Typ)
- and then Present (Packed_Array_Impl_Type (Typ))
- then
- return May_Generate_Large_Temp (Packed_Array_Impl_Type (Typ));
- end if;
-
- return True;
- end May_Generate_Large_Temp;
-
---------------------------------------
-- Move_To_Initialization_Statements --
---------------------------------------
-- known size, but we can't consider them that way here, because we are
-- talking about the actual size of the object.
- -- We also make sure that in addition to the size being known, we do not
- -- have a case which might generate an embarrassingly large temp in
- -- stack checking mode.
-
elsif Size_Known_At_Compile_Time (Otyp)
- and then
- (not Stack_Checking_Enabled
- or else not May_Generate_Large_Temp (Otyp))
and then not (Is_Record_Type (Otyp) and then not Is_Constrained (Otyp))
then
return True;
-- typically return Standard_Short_Integer. For fixed-point types, this
-- will return integer types of the corresponding size.
- function May_Generate_Large_Temp (Typ : Entity_Id) return Boolean;
- -- Determines if the given type, Typ, may require a large temporary of the
- -- kind that causes back-end trouble if stack checking is enabled. The
- -- result is True only the size of the type is known at compile time and
- -- large, where large is defined heuristically by the body of this routine.
- -- The purpose of this routine is to help avoid generating troublesome
- -- temporaries that interfere with stack checking mechanism. Note that the
- -- caller has to check whether stack checking is actually enabled in order
- -- to guide the expansion (typically of a function call).
-
procedure Move_To_Initialization_Statements (Decl, Stop : Node_Id);
-- Decl is an N_Object_Declaration node and Stop is a node past Decl in
-- the same list. Move all the nodes on the list between Decl and Stop