aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/bindo.adb
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2019-07-10 09:00:59 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-10 09:00:59 +0000
commit9098d477ba81e9fba2c41611513bbd643f5caab1 (patch)
tree71b7c7c6c5ab74bdaf085fa64e84d2e6c375aa8d /gcc/ada/bindo.adb
parent74b96685bb00766f8931c95d45d6e2c4d719cf1a (diff)
downloadgcc-9098d477ba81e9fba2c41611513bbd643f5caab1.zip
gcc-9098d477ba81e9fba2c41611513bbd643f5caab1.tar.gz
gcc-9098d477ba81e9fba2c41611513bbd643f5caab1.tar.bz2
[Ada] Elaboration order v4.0 and cycle detection
This patch introduces a new cycle detection algorithm which is based on Tarjan's "Enumeration of the Elementary Circuits of a Directed Graph" algorithm, with several ideas borrowed from Jonson's "Finding all the Elementary Circuits of a Directed Graph" algorithm. No need for a test because the new algorithm improves the performance of cycle detection only. 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * bindo.adb: Update the section on switches. * bindo-graphs.adb (Add_Cycle, Add_Vertex_And_Complement): Remove. (Create): The graph no longer needs a set of recorded cycles because the cycles are not rediscovered in permuted forms. (Cycle_End_Vertices): New routine. (Destroy): The graph no longer needs a set of recorded cycles because the cycles are not rediscovered in permuted forms. (Destroy_Library_Graph_Vertex): Move to the library level. (Find_All_Cycles_Through_Vertex, Find_All_Cycles_With_Edge): Remove. (Find_Cycles_From_Successor, Find_Cycles_From_Vertex, Find_Cycles_In_Component, Has_Elaborate_All_Edge): New routines. (Insert_And_Sort): Remove. (Is_Elaborate_Body_Edge): Use predicate Is_Vertex_With_Elaborate_Body. (Is_Recorded_Cycle): Remove. (Is_Vertex_With_Elaborate_Body): New routine. (Normalize_And_Add_Cycle): Remove. (Precedence): Rename to xxx_Precedence, where xxx relates to the input. These versions better reflect the desired input precedence. (Record_Cycle): New routine. (Remove_Vertex_And_Complement, Set_Is_Recorded_Cycle): Remove. (Trace_xxx): Update all versions to use debug switch -d_t. (Trace_Component): New routine. (Trace_Eol): Removed. (Trace_Vertex): Do not output the component as this information is already available when the component is traced. (Unvisit, Visit): New routine. * bindo-graphs.ads: Add new instance LGV_Lists. Remove instance RC_Sets. Update the structure of type Library_Graph_Attributes to remove the set of recorded cycles. (Destroy_Library_Graph_Vertex): Move to the library level. * bindo-writers.adb (Write_Component_Vertices): Output information about the number of vertices. * debug.adb: Document the use of binder switch -d_t. Update the use of binder switch -d_T. From-SVN: r273330
Diffstat (limited to 'gcc/ada/bindo.adb')
-rw-r--r--gcc/ada/bindo.adb11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ada/bindo.adb b/gcc/ada/bindo.adb
index 519887d..c467617 100644
--- a/gcc/ada/bindo.adb
+++ b/gcc/ada/bindo.adb
@@ -322,6 +322,11 @@ package body Bindo is
-- In addition, GNATbind does not create an edge to the body of the
-- pragma argument.
--
+ -- -d_t Output cycle detection trace information
+ --
+ -- GNATbind outputs trace information on cycle detection activities
+ -- to standard output.
+ --
-- -d_A Output ALI invocation tables
--
-- GNATbind outputs the contents of ALI table Invocation_Constructs
@@ -352,8 +357,8 @@ package body Bindo is
--
-- -d_T Output elaboration-order trace information
--
- -- GNATbind outputs trace information on elaboration-order and cycle-
- -- detection activities to standard output.
+ -- GNATbind outputs trace information on elaboration-order detection
+ -- activities to standard output.
--
-- -d_V Validate bindo cycles, graphs, and order
--
@@ -395,7 +400,7 @@ package body Bindo is
-- number of files in the bind, Bindo may emit anywhere between several MBs
-- to several hundred MBs of data to standard output. The switches are:
--
- -- -d_A -d_C -d_I -d_L -d_P -d_T -d_V
+ -- -d_A -d_C -d_I -d_L -d_P -d_t -d_T -d_V
--
-- Bindo offers several debugging routines that can be invoked from gdb.
-- Those are defined in the body of Bindo.Writers, in sections denoted by