+2015-10-23 Gary Dismukes <dismukes@adacore.com>
+
+ * bindgen.adb, restrict.adb: Minor spelling/grammar fixes.
+
+2015-10-23 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_res.adb (Resolve_Entity_Name): Code cleanup. Check for possible
+ elaboration issues in SPARK when the name denotes a source variable.
+
2015-10-23 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch7.adb (Process_Transient_Objects): Reimplement to properly
Par := Parent (Par);
end if;
- -- The following checks are only relevant when SPARK_Mode is on as they
- -- are not standard Ada legality rules. An effectively volatile object
- -- subject to enabled properties Async_Writers or Effective_Reads must
- -- appear in a specific context.
-
- if SPARK_Mode = On
- and then Is_Object (E)
- and then Is_Effectively_Volatile (E)
- and then (Async_Writers_Enabled (E)
- or else Effective_Reads_Enabled (E))
- and then Comes_From_Source (N)
- then
- -- The effectively volatile objects appears in a "non-interfering
- -- context" as defined in SPARK RM 7.1.3(12).
+ if Comes_From_Source (N) then
- if Is_OK_Volatile_Context (Par, N) then
- null;
+ -- The following checks are only relevant when SPARK_Mode is on as
+ -- they are not standard Ada legality rules.
- -- Otherwise the context causes a side effect with respect to the
- -- effectively volatile object.
+ if SPARK_Mode = On then
- else
- SPARK_Msg_N
- ("volatile object cannot appear in this context "
- & "(SPARK RM 7.1.3(12))", N);
- end if;
- end if;
+ -- An effectively volatile object subject to enabled properties
+ -- Async_Writers or Effective_Reads must appear in non-interfering
+ -- context (SPARK RM 7.1.3(12)).
- -- A Ghost entity must appear in a specific context
+ if Is_Object (E)
+ and then Is_Effectively_Volatile (E)
+ and then (Async_Writers_Enabled (E)
+ or else Effective_Reads_Enabled (E))
+ and then not Is_OK_Volatile_Context (Par, N)
+ then
+ SPARK_Msg_N
+ ("volatile object cannot appear in this context "
+ & "(SPARK RM 7.1.3(12))", N);
+ end if;
- if Is_Ghost_Entity (E) and then Comes_From_Source (N) then
- Check_Ghost_Context (E, N);
- end if;
+ -- Check possible elaboration issues with respect to variables
+
+ if Ekind (E) = E_Variable then
+ Check_Elab_Call (N);
+ end if;
+ end if;
- -- In SPARK mode, need to check possible elaboration issues
+ -- A Ghost entity must appear in a specific context
- if SPARK_Mode = On and then Ekind (E) = E_Variable then
- Check_Elab_Call (N);
+ if Is_Ghost_Entity (E) then
+ Check_Ghost_Context (E, N);
+ end if;
end if;
end Resolve_Entity_Name;