+2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_prag.adb (Expand_Pragma_Initial_Condition): Do not
+ generate an Initial_Condition procedure and a call to it when
+ the associated pragma is ignored.
+ * sem_ch10.adb (Analyze_Compilation_Unit): Minor cleanup.
+
2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
* fe.h (Debug_Generated_Code): Declare.
Expr := Get_Pragma_Arg (First (Pragma_Argument_Associations (IC_Prag)));
Loc := Sloc (IC_Prag);
+ -- Nothing to do when the pragma is ignored because its semantics are
+ -- suppressed.
+
+ if Is_Ignored (IC_Prag) then
+ return;
+
-- Nothing to do when the pragma or its argument are illegal because
-- there is no valid expression to check.
- if Error_Posted (IC_Prag) or else Error_Posted (Expr) then
+ elsif Error_Posted (IC_Prag) or else Error_Posted (Expr) then
return;
end if;
-- binder generated code of all the units involved in a partition
-- when control-flow preservation is requested.
- -- Case of units which do not require an elaboration entity
-
if not Opt.Suppress_Control_Flow_Optimizations
and then
( -- Pure units do not need checks
or else Acts_As_Spec (N)
)
then
- -- This is a case where we only need the entity for
- -- checking to prevent multiple elaboration checks.
+ -- This is a case where we only need the entity for checking to
+ -- prevent multiple elaboration checks.
Set_Elaboration_Entity_Required (Spec_Id, False);
- -- Case of elaboration entity is required for access before
- -- elaboration checking (so certainly we must build it).
+ -- Otherwise the unit requires an elaboration entity because it
+ -- carries a body.
else
- Set_Elaboration_Entity_Required (Spec_Id, True);
+ Set_Elaboration_Entity_Required (Spec_Id);
end if;
Build_Elaboration_Entity (N, Spec_Id);