aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref-spark_specific.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-27 12:21:23 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-27 12:21:23 +0100
commitf6f401140a4a93899d25eeb05a537d35f4324f6f (patch)
treed27facc59cc94a59a1d88d59f763949e8b0d6e65 /gcc/ada/lib-xref-spark_specific.adb
parent3f8743e802e6927c8ea91911fd9e313137b73c50 (diff)
downloadgcc-f6f401140a4a93899d25eeb05a537d35f4324f6f.zip
gcc-f6f401140a4a93899d25eeb05a537d35f4324f6f.tar.gz
gcc-f6f401140a4a93899d25eeb05a537d35f4324f6f.tar.bz2
[multiple changes]
2015-10-27 Yannick Moy <moy@adacore.com> * lib-xref-spark_specific.adb (Enclosing_Subprogram_Or_Library_Package): detect library-level subprograms and handle entries as subprograms, i.e. now both library-level subprograms and entry bodies act as enclosing scopes. (Traverse_Declarations_Or_Statements): process entry bodies just like subprogram bodies. * lib-xref.ads (Enclosing_Subprogram_Or_Library_Package): comment simplified while keeping its the meaning and minor typo fixed ("of" -> "or"). * spark_xrefs.ads (Xref Section): fix in description of the ALI line for subprogram calls; such lines start with captial "F" followed by a space. 2015-10-27 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Find_Direct_Name): A parameter association is a legal context for applying an implicit dereference. (Analyze_Expanded_Name): Minor code cleanup. From-SVN: r229418
Diffstat (limited to 'gcc/ada/lib-xref-spark_specific.adb')
-rw-r--r--gcc/ada/lib-xref-spark_specific.adb12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ada/lib-xref-spark_specific.adb b/gcc/ada/lib-xref-spark_specific.adb
index 631c87b..fce0cf0 100644
--- a/gcc/ada/lib-xref-spark_specific.adb
+++ b/gcc/ada/lib-xref-spark_specific.adb
@@ -1032,6 +1032,12 @@ package body SPARK_Specific is
and then Nkind (Parent (N)) in N_Subprogram_Specification
then
Result := Parent (Parent (Parent (N)));
+
+ -- If this was a library-level subprogram then replace Result with
+ -- its Unit, which points to N_Subprogram_* node.
+ if Nkind (Result) = N_Compilation_Unit then
+ Result := Unit (Result);
+ end if;
else
Result := N;
end if;
@@ -1090,6 +1096,10 @@ package body SPARK_Specific is
Result := Parent (Result);
end if;
+ when N_Entry_Body =>
+ Result := Defining_Identifier (Result);
+ exit;
+
when others =>
Result := Parent (Result);
end case;
@@ -1431,6 +1441,8 @@ package body SPARK_Specific is
if Nkind (N) in N_Declaration
or else
Nkind (N) in N_Later_Decl_Item
+ or else
+ Nkind (N) = N_Entry_Body
then
Process (N);
end if;