when N_Attribute_Reference =>
case Get_Attribute_Id (Attribute_Name (N)) is
+ -- For Min/Max attributes, we can refine the range using the
+ -- possible range of values of the attribute expressions.
+
+ when Attribute_Min
+ | Attribute_Max
+ =>
+ Determine_Range
+ (First (Expressions (N)),
+ OK1, Lo_Left, Hi_Left, Assume_Valid);
+
+ if OK1 then
+ Determine_Range
+ (Next (First (Expressions (N))),
+ OK1, Lo_Right, Hi_Right, Assume_Valid);
+ end if;
+
+ if OK1 then
+ Lor := UI_Min (Lo_Left, Lo_Right);
+ Hir := UI_Max (Hi_Left, Hi_Right);
+ end if;
+
-- For Pos/Val attributes, we can refine the range using the
-- possible range of values of the attribute expression.
then
declare
Decl : Node_Id;
+ pragma Warnings (Off, Decl);
+ -- Suppress warning for the final removal loop
Lvl : Entity_Id;
Res : Entity_Id;
Temp : Node_Id;
-- expansion if we are dealing with a function
-- call.
- if Nkind (Call_Node) =
- N_Procedure_Call_Statement
+ if Nkind (Call_Node) = N_Procedure_Call_Statement
then
-- Generate:
-- Lvl : Natural;
Set_Expression (Call_Node, Relocate_Node (Temp));
Call_Node := Expression (Call_Node);
- Remove (Next (Decl));
+
+ -- Remove the declaration of the dummy and the
+ -- subsequent actions its analysis has created.
+
+ while Present (Remove_Next (Decl)) loop
+ null;
+ end loop;
end if;
-- Decorate the conditional expression with
then
-- Generate the minimum accessibility level object
- -- A60b : integer := integer'min(2, paramL);
+ -- A60b : natural := natural'min(1, paramL);
declare
Loc : constant Source_Ptr := Sloc (Body_Nod);
Make_Temporary
(Loc, 'A', Extra_Accessibility (Form)),
Object_Definition => New_Occurrence_Of
- (Standard_Integer, Loc),
+ (Standard_Natural, Loc),
Expression =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of
- (Standard_Integer, Loc),
+ (Standard_Natural, Loc),
Attribute_Name => Name_Min,
Expressions => New_List (
Make_Integer_Literal (Loc,