[Ada] Attach the special GNATprove HEAP entity to the Standard package
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 17 Jul 2018 08:05:54 +0000 (08:05 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 17 Jul 2018 08:05:54 +0000 (08:05 +0000)
In GNATprove mode we use frontend cross-references to synthesize the
Global contract of subprograms with SPARK_Mode => Off and represent
a read/write via a pointer as a read/write of a special entity called
HEAP. This entity is now attached to the Standard package, so that we can
safely check the Ekind of its Scope, which now happens in Scope_Within.

This only affects GNATprove, so no frontend test provided.

2018-07-17  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
the Standard package.

From-SVN: r262771

gcc/ada/ChangeLog
gcc/ada/lib-xref-spark_specific.adb

index 5aff421a5b449c5828b3f3c4083d04f220d015f5..0e2d04edda7227248eb0f1769ee13530d7be06b3 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
+
+       * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
+       the Standard package.
+
 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
 
        * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
index 834ddc0ae66a0a384d9fd3a8f8c48f942845f663..0ce834a616bb5be71eea33802bfbabea8e71942c 100644 (file)
@@ -287,6 +287,7 @@ package body SPARK_Specific is
 
          Set_Ekind       (Heap, E_Variable);
          Set_Is_Internal (Heap, True);
+         Set_Scope       (Heap, Standard_Standard);
          Set_Has_Fully_Qualified_Name (Heap);
       end Create_Heap;