if Scope_Is_Transient and then N = Node_To_Be_Wrapped then
case Nkind (N) is
- when N_Pragma
- | N_Procedure_Call_Statement
+ when N_Procedure_Call_Statement
| N_Statement_Other_Than_Procedure_Call
=>
Wrap_Transient_Statement (N);
else
if Is_Checked (N) then
Install_Ghost_Region (Check, N, Level);
- elsif Is_Ignored (N) then
- Install_Ghost_Region (Ignore, N, Level);
else
Install_Ghost_Region (None, N, Level);
end if;
Set_Is_Constrained (Id, Is_Constrained (T));
Set_Is_IEEE_Extended_Precision
(Id, Is_IEEE_Extended_Precision (T));
+ Copy_RM_Size (To => Id, From => T);
-- If the floating point type has dimensions, these will be
-- inherited subsequently when Analyze_Dimensions is called.
Preanalyze_And_Resolve (Arg_Message, Standard_String);
end if;
- if Expander_Active and Is_Ignored_In_Codegen (N) then
-
- -- Even though technically ignored assertions are not ghost
- -- code they should behave the same way. Meaning that they
- -- should be analyzed but they should not affect the generated
- -- code. Use the ignored ghost mechanism here to ensure that
- -- the original pragma and any expanded code is also removed.
- -- Ideally these two cases should be separated in the
- -- implementation ???
-
- Mark_Ghost_Pragma (N, Opt.Ignore);
+ -- When expansion is active but check is not, only preanalyze the
+ -- boolean to avoid pulling useless dependencies.
+ if Expander_Active and Is_Ignored_In_Codegen (N) then
In_Assertion_Expr := In_Assertion_Expr + 1;
- Analyze_And_Resolve (Arg_Check, Any_Boolean);
+ Preanalyze_And_Resolve (Arg_Check, Any_Boolean);
In_Assertion_Expr := In_Assertion_Expr - 1;
-- Suppress any warnings on the condition we might get
Check_Assertion_Failure (Arg_Check);
+ -- Rewrite the pragma as a null statement
+
+ Rewrite (N, Make_Null_Statement (Loc));
+ Analyze (N);
+
-- Check is active or expansion not active. In these cases we can
-- just go ahead and analyze the boolean with no worries.