[Ada] Elaboration order v4.0 and infinite loops

Programming / Compilers / GCC - pmderodat [138bc75d-0d04-0410-961f-82ee72b054a4] - 11 July 2019 08:01 EDT

This patch introduces binder switch -d_S which prompts the various phases of the elaboration order mechanism to output a short message concerning their commencement and completion. The output is useful when trying to determine whether a phase is stuck in an infinite loop.


-- Source --


-- main.adb

procedure Main is begin null; end Main;


-- Compilation and output --


$ gnatmake -q main.adb -bargs -d_S -d_V elaborating units... collecting units... units collected. constructing library graph...
validating library graph... library graph validated. library graph constructed. constructing invocation graph...
validating invocation graph... invocation graph validated. invocation graph constructed. augmenting library graph... library graph augmented. discovering components... components discovered.
validating elaboration order... elaboration order validated. units elaborated.

2019-07-11 Hristian Kirtchev

gcc/ada/

- bindo.adb: Update the section of switches and debugging elaboration issues.
- bindo.ads: Add type Elaboration_Phase.
- bindo-augmentors.adb: Add use clause for Bindo.Writers.Phase_Writers. (Augment_Library_Graph): Signal the start and end of the aubmentation phase.
- bindo-builders.adb: Add with and use clause for Bindo.Writers. Add use clause for Bindo.Writers.Phase_Writers. (Build_Invocation_Graph): Signal the start and end of the invocation graph construction phase. (Build_Library_Graph): Signal the start and end of the library graph construction phase.
- bindo-diagnostics.adb: Add use clause for Bindo.Writers.Phase_Writers. (Diagnose_Cycle): Signal the start and end of the cycle diagnostic phase.
- bindo-elaborators.adb: Add use clause for Bindo.Writers.Phase_Writers. (Elaborate_Units): Signal the start and end of the unit elaboration phase.
- bindo-graphs.adb: Add use clause for Bindo.Writers.Phase_Writers. (Find_Components): Signal the start and end of the component discovery phase. (Find_Cycles): Signal the start and end of the cycle discovery phase.
- bindo-units.adb: Add with and use clause for Bindo.Writers. Add use clause for Bindo.Writers.Phase_Writers. (Collect_Elaborable_Units): Signal the start and end of the unit collection phase.
- bindo-validators.adb: Add with and use clause for Bindo.Writers. Add use clause for Bindo.Writers.Phase_Writers. (Validate_Cycles, Validate_Elaboration_Order,
Validate_Invocation_Graph, Validate_Library_Graph): Signal the start and end of the libray graph validation phase.
- bindo-writers.ads, bindo-writers.adb: Add new nested package Phase_Writers.
- debug.adb: Update the documentation of switch d_S.

12b1c23bb8c [Ada] Elaboration order v4.0 and infinite loops
gcc/ada/ChangeLog | 42 +++++++++++++++++++++
gcc/ada/bindo-augmentors.adb | 8 +++-
gcc/ada/bindo-builders.adb | 10 +++++
gcc/ada/bindo-diagnostics.adb | 5 +++
gcc/ada/bindo-elaborators.adb | 4 ++
gcc/ada/bindo-graphs.adb | 8 ++++
gcc/ada/bindo-units.adb | 8 ++++
gcc/ada/bindo-validators.adb | 27 +++++++++++--
gcc/ada/bindo-writers.adb | 88 +++++++++++++++++++++++++++++++++++++++++++
gcc/ada/bindo-writers.ads | 17 +++++++++
gcc/ada/bindo.adb | 10 +++++
gcc/ada/bindo.ads | 18 +++++++++
gcc/ada/debug.adb | 7 +++-
13 files changed, 246 insertions(+), 6 deletions(-)

Upstream: gcc.gnu.org


  • Share