-- end loop;
procedure Expand_Pragma_Loop_Variant (N : Node_Id) is
- Last_Var : constant Node_Id :=
- Last (Pragma_Argument_Associations (N));
- Loc : constant Source_Ptr := Sloc (N);
- Curr_Assign : List_Id := No_List;
- Flag_Id : Entity_Id := Empty;
- If_Stmt : Node_Id := Empty;
+ Loc : constant Source_Ptr := Sloc (N);
+
+ Last_Var : constant Node_Id := Last (Pragma_Argument_Associations (N));
+
+ Curr_Assign : List_Id := No_List;
+ Flag_Id : Entity_Id := Empty;
+ If_Stmt : Node_Id := Empty;
+ Old_Assign : List_Id := No_List;
Loop_Scop : Entity_Id;
Loop_Stmt : Node_Id;
- Old_Assign : List_Id := No_List;
Variant : Node_Id;
procedure Process_Variant (Variant : Node_Id; Is_Last : Boolean);
begin
if Chars (Variant) = Name_Increases then
return Make_Op_Gt (Loc, Curr_Val, Old_Val);
-
else pragma Assert (Chars (Variant) = Name_Decreases);
return Make_Op_Lt (Loc, Curr_Val, Old_Val);
end if;
-- Generate:
-- Old : <type of Expr>;
- Old_Id := Make_Temporary (Loc, 'P');
+ Old_Id := Make_Temporary (Loc, 'P');
Insert_Action (Loop_Stmt,
Make_Object_Declaration (Loop_Loc,
-- Skip these type conversion checks if universal fixed operands
-- operands involved, since range checks are handled separately for
-- these cases (in the appropriate Expand routines in unit Exp_Fixd).
- -- Also skip type conversion checks in formal verification mode, as the
- -- formal verification backend deals directly with these checks.
if Nkind (N) = N_Type_Conversion
and then not Is_Generic_Type (Root_Type (Target_Typ))
and then Target_Typ /= Universal_Fixed
and then Operand_Typ /= Universal_Fixed
+
+ -- Also skip type conversion checks in formal verification mode, as
+ -- the formal verification backend deals directly with these checks.
+
and then not Alfa_Mode
then
Apply_Type_Conversion_Checks (N);