aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/debug.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2023-02-06 11:58:52 -0500
committerMarc Poulhiès <poulhies@adacore.com>2023-05-22 10:44:10 +0200
commitaf1914998dcfb9908afe85b2275fd9868d689db9 (patch)
treedba795b83a20021408187e8bb20c63a38d573819 /gcc/ada/debug.adb
parent472f4cb52ac6f47926a19eb2c53cd848fa6b3730 (diff)
downloadgcc-af1914998dcfb9908afe85b2275fd9868d689db9.zip
gcc-af1914998dcfb9908afe85b2275fd9868d689db9.tar.gz
gcc-af1914998dcfb9908afe85b2275fd9868d689db9.tar.bz2
ada: Add Is_Past_Self_Hiding_Point flag
This patch adds a flag Is_Past_Self_Hiding_Point. When False, this will replace E_Void as the indicator for a premature use of a declaration within itself -- for example, "X : T := X;". One might think this flag should be called something like Is_Hidden_From_All_Visibility, reversing the sense of Is_Past_Self_Hiding_Point. We don't do that because we want Is_Past_Self_Hiding_Point to be initially False by default (and we have no mechanism for defaulting to True), and because it doesn't exactly match the RM definition of "hidden from all visibility" (for example, for record components). This is work in progress; more changes are needed before we can remove all Mutate_Ekind(..., E_Void). gcc/ada/ * einfo.ads (Is_Past_Self_Hiding_Point): Document. * gen_il-fields.ads (Is_Past_Self_Hiding_Point): Add to list of fields. * gen_il-gen-gen_entities.adb (Is_Past_Self_Hiding_Point): Declare in all entities. * exp_aggr.adb: Set Is_Past_Self_Hiding_Point as appropriate. * sem.adb: Likewise. * sem_aggr.adb: Likewise. * sem_ch11.adb: Likewise. * sem_ch12.adb: Likewise. * sem_ch5.adb: Likewise. * sem_ch7.adb: Likewise. * sem_prag.adb: Likewise. * sem_ch6.adb: Likewise. (Set_Formal_Mode): Minor cleanup: Move from spec. * sem_ch6.ads: (Set_Formal_Mode): Minor cleanup: Move to body. * cstand.adb: Call Set_Is_Past_Self_Hiding_Point on all entities as soon as they are created. * comperr.adb (Compiler_Abort): Minor cleanup -- use 'in' instead of 'or else'. * debug.adb: Minor comment cleanups.
Diffstat (limited to 'gcc/ada/debug.adb')
-rw-r--r--gcc/ada/debug.adb23
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 7497fa0..9566e09 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -41,7 +41,7 @@ package body Debug is
-- dh Generate listing showing loading of name table hash chains
-- di Generate messages for visibility linking/delinking
-- dj Suppress "junk null check" for access parameter values
- -- dk Generate GNATBUG message on abort, even if previous errors
+ -- dk Generate "GNAT BUG" message on abort, even if previous errors
-- dl Generate unit load trace messages
-- dm Prevent special frontend inlining in GNATprove mode
-- dn Generate messages for node/list allocation
@@ -113,7 +113,7 @@ package body Debug is
-- d.z Restore previous support for frontend handling of Inline_Always
-- d.A Enable statistics printing in Atree
- -- d.B Generate a bug box on abort_statement
+ -- d.B Generate a "GNAT BUG" message on abort_statement
-- d.C Generate concatenation call, do not generate inline code
-- d.D Disable errors on use of overriding keyword in Ada 95 mode
-- d.E Turn selected errors into warnings
@@ -486,9 +486,12 @@ package body Debug is
-- GNAT before 3.10, so this switch can ease the transition process.
-- dk Immediate kill on abort. Normally on an abort (i.e. a call to
- -- Comperr.Compiler_Abort), the GNATBUG message is not given if
- -- there is a previous error. This debug switch bypasses this test
- -- and gives the message unconditionally (useful for debugging).
+ -- Comperr.Compiler_Abort), the "GNAT BUG" message is not given if
+ -- there is a previous error. Instead, the message "compilation
+ -- abandoned due to previous error" is given. This debug switch
+ -- bypasses this test and gives the "GNAT BUG" message unconditionally
+ -- (useful for debugging). Use -gnatdO in addition to see the previous
+ -- errors.
-- dl Generate unit load trace messages. A line of traceback output is
-- generated each time a request is made to the library manager to
@@ -835,12 +838,12 @@ package body Debug is
-- with -gnatd.A. You might want to apply "sort -nr" to parts of the
-- output.
- -- d.B Generate a bug box when we see an abort_statement, even though
- -- there is no bug. Useful for testing Comperr.Compiler_Abort: write
- -- some code containing an abort_statement, and compile it with
+ -- d.B Generate a "GNAT BUG" message when we see an abort_statement, even
+ -- though there is no bug. Useful for testing Comperr.Compiler_Abort:
+ -- write some code containing an abort_statement, and compile it with
-- -gnatd.B. There is nothing special about abort_statements; it just
- -- provides a way to control where the bug box is generated. See "when
- -- N_Abort_Statement" in package body Expander.
+ -- provides a way to control where the bug box is generated. See the
+ -- "when N_Abort_Statement" in package body Expander.
-- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases
-- where we would normally generate inline concatenation code.