aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/scans.ads
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2022-11-07 09:25:31 -0500
committerMarc Poulhiès <poulhies@adacore.com>2022-11-14 14:46:51 +0100
commit438f878718f81302205b5241dd325bb841c8c92c (patch)
tree257239eb0a0285effb6af91c9e650d8275619a73 /gcc/ada/scans.ads
parent0e194d289d4d1c9aa16d14c4b94caf11c2506da3 (diff)
downloadgcc-438f878718f81302205b5241dd325bb841c8c92c.zip
gcc-438f878718f81302205b5241dd325bb841c8c92c.tar.gz
gcc-438f878718f81302205b5241dd325bb841c8c92c.tar.bz2
ada: Remove incorrect comments about initialization
Cleanup only; no change in behavior. This patch removes and rewrites some comments regarding initialization. These initializions are needed, so there's no need to apologize for initializing these variables. Note that -gnatVa is not relevant; reads of uninitialized variables are wrong, whether or not we get caught. gcc/ada/ * atree.ads: Remove some comments. * err_vars.ads: Likewise. * scans.ads: Likewise. * sinput.ads: Likewise. * checks.ads: Likewise. Also add a "???" comment indicating an obsolete comment that is too difficult to correct at this time. * sem_attr.adb: Minor comment rewrite.
Diffstat (limited to 'gcc/ada/scans.ads')
-rw-r--r--gcc/ada/scans.ads27
1 files changed, 12 insertions, 15 deletions
diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads
index dbe9e5a..ddb4c3e 100644
--- a/gcc/ada/scans.ads
+++ b/gcc/ada/scans.ads
@@ -358,38 +358,35 @@ package Scans is
-- Note: these variables can only be referenced during the parsing of a
-- file. Reference to any of them from Sem or the expander is wrong.
- -- These variables are initialized as required by Scn.Initialize_Scanner,
- -- and should not be referenced before such a call. However, there are
- -- situations in which these variables are saved and restored, and this
- -- may happen before the first Initialize_Scanner call, resulting in the
- -- assignment of invalid values. To avoid this, and allow building with
- -- the -gnatVa switch, we initialize some variables to known valid values.
-
- Scan_Ptr : Source_Ptr := No_Location; -- init for -gnatVa
+ -- These variables are initialized by Scn.Initialize_Scanner, and should
+ -- not be referenced before such a call, except for saving and restoring
+ -- them.
+
+ Scan_Ptr : Source_Ptr := No_Location;
-- Current scan pointer location. After a call to Scan, this points
-- just past the end of the token just scanned.
- Token : Token_Type := No_Token; -- init for -gnatVa
+ Token : Token_Type := No_Token;
-- Type of current token
- Token_Ptr : Source_Ptr := No_Location; -- init for -gnatVa
+ Token_Ptr : Source_Ptr := No_Location;
-- Pointer to first character of current token
- Current_Line_Start : Source_Ptr := No_Location; -- init for -gnatVa
+ Current_Line_Start : Source_Ptr := No_Location;
-- Pointer to first character of line containing current token
- Start_Column : Column_Number := No_Column_Number; -- init for -gnatVa
+ Start_Column : Column_Number := No_Column_Number;
-- Starting column number (zero origin) of the first non-blank character
-- on the line containing the current token. This is used for error
-- recovery circuits which depend on looking at the column line up.
- Type_Token_Location : Source_Ptr := No_Location; -- init for -gnatVa
+ Type_Token_Location : Source_Ptr := No_Location;
-- Within a type declaration, gives the location of the TYPE keyword that
-- opened the type declaration. Used in checking the end column of a record
-- declaration, which can line up either with the TYPE keyword, or with the
-- start of the line containing the RECORD keyword.
- Checksum : Word := 0; -- init for -gnatVa
+ Checksum : Word := 0;
-- Used to accumulate a CRC representing the tokens in the source
-- file being compiled. This CRC includes only program tokens, and
-- excludes comments.
@@ -399,7 +396,7 @@ package Scans is
-- limited view of a package, i.e. visible type names and related
-- tagged indicators.
- First_Non_Blank_Location : Source_Ptr := No_Location; -- init for -gnatVa
+ First_Non_Blank_Location : Source_Ptr := No_Location;
-- Location of first non-blank character on the line containing the
-- current token (i.e. the location of the character whose column number
-- is stored in Start_Column).