aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.ads
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2018-08-21 14:44:30 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-08-21 14:44:30 +0000
commitb7e875ce96282a9c4ecc6cfd4f043c1039e5b7e3 (patch)
treea9dfcb7a1ec4ecb3fe41a5b2e8d84f2d56024cef /gcc/ada/lib-xref.ads
parentd40800cfe589cf55e074ed151c7a607d5680997a (diff)
downloadgcc-b7e875ce96282a9c4ecc6cfd4f043c1039e5b7e3.zip
gcc-b7e875ce96282a9c4ecc6cfd4f043c1039e5b7e3.tar.gz
gcc-b7e875ce96282a9c4ecc6cfd4f043c1039e5b7e3.tar.bz2
[Ada] Handle pragmas that come from aspects for GNATprove
In GNATprove we appear to abuse a routine related to cross-references and expect it to deliver exact results, which is not what it was designed for. This patch is a temporary solution to avoid crashes in GNATprove; it doesn't affect the frontend or other backends, because this code is used exclusively by GNATprove (it is located in the frontend for technical reasons). No tests provided. 2018-08-21 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * lib-xref.ads, lib-xref-spark_specific.adb (Enclosing_Subprogram_Or_Library_Package): Now roughtly works for pragmas that come from aspect specifications. From-SVN: r263707
Diffstat (limited to 'gcc/ada/lib-xref.ads')
-rw-r--r--gcc/ada/lib-xref.ads5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/lib-xref.ads b/gcc/ada/lib-xref.ads
index 5c7a086..903e64e 100644
--- a/gcc/ada/lib-xref.ads
+++ b/gcc/ada/lib-xref.ads
@@ -632,6 +632,11 @@ package Lib.Xref is
-- Return the closest enclosing subprogram or library-level package.
-- This ensures that GNATprove can distinguish local variables from
-- global variables.
+ --
+ -- ??? This routine should only be used for processing related to
+ -- cross-references, where it might return wrong result but must avoid
+ -- crashes on ill-formed source code. It is wrong to use it where exact
+ -- result is needed.
procedure Generate_Dereference
(N : Node_Id;