-- in
-- raise Constraint_Error;
- -- unless the flag Convert_To_Return_False is set, in which case
- -- the transformation is to:
-
- -- do
- -- return False;
- -- in
- -- raise Constraint_Error;
-
-- The raise constraint error can never be executed. It is just a dummy
-- node that can be labeled with an arbitrary type.
RCE := Make_Raise_Constraint_Error (Loc, Reason => CE_Explicit_Raise);
Set_Etype (RCE, Typ);
- if Convert_To_Return_False (N) then
- Rewrite (N,
- Make_Expression_With_Actions (Loc,
- Actions => New_List (
- Make_Simple_Return_Statement (Loc,
- Expression => New_Occurrence_Of (Standard_False, Loc))),
- Expression => RCE));
-
- else
- Rewrite (N,
- Make_Expression_With_Actions (Loc,
- Actions => New_List (
- Make_Raise_Statement (Loc,
- Name => Name (N),
- Expression => Expression (N))),
- Expression => RCE));
- end if;
+ Rewrite (N,
+ Make_Expression_With_Actions (Loc,
+ Actions => New_List (
+ Make_Raise_Statement (Loc,
+ Name => Name (N),
+ Expression => Expression (N))),
+ Expression => RCE));
Analyze_And_Resolve (N, Typ);
end Expand_N_Raise_Expression;
Contract_Test_Cases,
Controlling_Argument,
Conversion_OK,
- Convert_To_Return_False,
Corresponding_Aspect,
Corresponding_Body,
Corresponding_Entry_Body,
Cc (N_Raise_Expression, N_Subexpr,
(Sy (Name, Node_Id, Default_Empty),
- Sy (Expression, Node_Id, Default_Empty),
- Sm (Convert_To_Return_False, Flag)));
+ Sy (Expression, Node_Id, Default_Empty)));
Cc (N_Range, N_Subexpr,
(Sy (Low_Bound, Node_Id),
-- direct conversion of the underlying integer result, with no regard to
-- the small operand.
- -- Convert_To_Return_False
- -- Present in N_Raise_Expression nodes that appear in the body of the
- -- special predicateM function used to test a predicate in the context
- -- of a membership test, where raise expression results in returning a
- -- value of False rather than raising an exception.
-
-- Corresponding_Aspect
-- Present in N_Pragma node. Used to point back to the source aspect from
-- the corresponding pragma. This field is Empty for source pragmas.
-- Sloc points to RAISE
-- Name (always present)
-- Expression (set to Empty if no expression present)
- -- Convert_To_Return_False
-- plus fields for expression
-------------------------------