aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref-spark_specific.adb
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2015-10-20 12:42:53 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 14:42:53 +0200
commit704228bdcc8e23d3ffd65748acbb6ee9ecba0083 (patch)
tree735688539c34748ea9b7b595752d4f0a5f93705c /gcc/ada/lib-xref-spark_specific.adb
parentc83075965b324e46b3225cac95391aaaa9fe1805 (diff)
downloadgcc-704228bdcc8e23d3ffd65748acbb6ee9ecba0083.zip
gcc-704228bdcc8e23d3ffd65748acbb6ee9ecba0083.tar.gz
gcc-704228bdcc8e23d3ffd65748acbb6ee9ecba0083.tar.bz2
fmap.adb, [...]: Fix coding style for marking start of processing of subprograms.
2015-10-20 Yannick Moy <moy@adacore.com> * fmap.adb, a-cihama.adb, sem_ch5.adb, make.adb, inline.adb, a-cfhase.adb, scng.adb, sem_ch12.adb, freeze.adb, tempdir.adb, sem_util.adb, sem_res.adb, s-regexp.adb, a-clrefi.adb: Fix coding style for marking start of processing of subprograms. 2015-10-20 Yannick Moy <moy@adacore.com> * lib-xref-spark_specific.adb (Add_SPARK_File): Start traversal by requesting info from stubs. (Traverse_All_Compilation_Units): Remove unused procedure. (Traverse_Declarations_Or_Statements): Handle protected and task units. * lib-xref.ads (Traverse_All_Compilation_Units): Remove unused procedure. * restrict.adb (Check_Restriction): Do not ignore restrictions in GNATprove_Mode. From-SVN: r229078
Diffstat (limited to 'gcc/ada/lib-xref-spark_specific.adb')
-rw-r--r--gcc/ada/lib-xref-spark_specific.adb70
1 files changed, 56 insertions, 14 deletions
diff --git a/gcc/ada/lib-xref-spark_specific.adb b/gcc/ada/lib-xref-spark_specific.adb
index b38d65b..a396714 100644
--- a/gcc/ada/lib-xref-spark_specific.adb
+++ b/gcc/ada/lib-xref-spark_specific.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2011-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 2011-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -154,7 +154,7 @@ package body SPARK_Specific is
Traverse_Compilation_Unit
(CU => Cunit (Ubody),
Process => Detect_And_Add_SPARK_Scope'Access,
- Inside_Stubs => False);
+ Inside_Stubs => True);
end if;
-- When two units are present for the same compilation unit, as it
@@ -166,7 +166,7 @@ package body SPARK_Specific is
Traverse_Compilation_Unit
(CU => Cunit (Uspec),
Process => Detect_And_Add_SPARK_Scope'Access,
- Inside_Stubs => False);
+ Inside_Stubs => True);
end if;
end if;
@@ -1151,17 +1151,6 @@ package body SPARK_Specific is
end if;
end Generate_Dereference;
- ------------------------------------
- -- Traverse_All_Compilation_Units --
- ------------------------------------
-
- procedure Traverse_All_Compilation_Units (Process : Node_Processing) is
- begin
- for U in Units.First .. Last_Unit loop
- Traverse_Compilation_Unit (Cunit (U), Process, Inside_Stubs => False);
- end loop;
- end Traverse_All_Compilation_Units;
-
-------------------------------
-- Traverse_Compilation_Unit --
-------------------------------
@@ -1300,6 +1289,59 @@ package body SPARK_Specific is
end;
end if;
+ -- Protected unit
+
+ when N_Protected_Definition =>
+ Traverse_Declarations_Or_Statements
+ (Visible_Declarations (N), Process, Inside_Stubs);
+ Traverse_Declarations_Or_Statements
+ (Private_Declarations (N), Process, Inside_Stubs);
+
+ when N_Protected_Body =>
+ Traverse_Declarations_Or_Statements
+ (Declarations (N), Process, Inside_Stubs);
+
+ when N_Protected_Body_Stub =>
+ if Present (Library_Unit (N)) then
+ declare
+ Body_N : constant Node_Id := Get_Body_From_Stub (N);
+ begin
+ if Inside_Stubs then
+ Traverse_Declarations_Or_Statements
+ (Declarations (Body_N), Process, Inside_Stubs);
+ end if;
+ end;
+ end if;
+
+ -- Task unit
+
+ when N_Task_Definition =>
+ Traverse_Declarations_Or_Statements
+ (Visible_Declarations (N), Process, Inside_Stubs);
+ Traverse_Declarations_Or_Statements
+ (Private_Declarations (N), Process, Inside_Stubs);
+
+ when N_Task_Body =>
+ Traverse_Declarations_Or_Statements
+ (Declarations (N), Process, Inside_Stubs);
+ Traverse_Handled_Statement_Sequence
+ (Handled_Statement_Sequence (N), Process, Inside_Stubs);
+
+ when N_Task_Body_Stub =>
+ if Present (Library_Unit (N)) then
+ declare
+ Body_N : constant Node_Id := Get_Body_From_Stub (N);
+ begin
+ if Inside_Stubs then
+ Traverse_Declarations_Or_Statements
+ (Declarations (Body_N), Process, Inside_Stubs);
+ Traverse_Handled_Statement_Sequence
+ (Handled_Statement_Sequence (Body_N), Process,
+ Inside_Stubs);
+ end if;
+ end;
+ end if;
+
-- Block statement
when N_Block_Statement =>