diff options
author | Vincent Celier <celier@adacore.com> | 2010-10-26 13:15:05 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-26 15:15:05 +0200 |
commit | b251750b22953106e31f33f86b6ff064f6a1b204 (patch) | |
tree | 4a832f2252eeeda8fa993dde3064c4bdaf25d7a1 /gcc/ada/scng.adb | |
parent | f2264ac2cd6325b96d5a742ce72159a011636f38 (diff) | |
download | gcc-b251750b22953106e31f33f86b6ff064f6a1b204.zip gcc-b251750b22953106e31f33f86b6ff064f6a1b204.tar.gz gcc-b251750b22953106e31f33f86b6ff064f6a1b204.tar.bz2 |
opt.ads (Checksum_Accumulate_Token_Checksum): New Boolean flag, defaulted to True.
2010-10-26 Vincent Celier <celier@adacore.com>
* opt.ads (Checksum_Accumulate_Token_Checksum): New Boolean flag,
defaulted to True.
(Checksum_GNAT_6_3): New name of Old_Checksums
(Checksum_GNAT_5_03): New name of Old_Old_Checksums
* prj-nmsc.adb (Process_Project_Level_Array_Attributes): Adapt to new
names of Opt flags.
Set Checksum_Accumulate_Token_Checksum to False if GNAT version is 5.03
or before.
* scng.adb (Accumulate_Token_Checksum_GNAT_6_3): New name of procedure
Accumulate_Token_Checksum_Old.
(Accumulate_Token_Checksum_GNAT_5_03): New name of procedure
Accumulate_Token_Checksum_Old_Old.
(Nlit): Call Accumulate_Token_Checksum only if
Opt.Checksum_Accumulate_Token_Checksum is True.
(Scan): Ditto
From-SVN: r165961
Diffstat (limited to 'gcc/ada/scng.adb')
-rw-r--r-- | gcc/ada/scng.adb | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index 1e1be01..f1386f8 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -68,17 +68,18 @@ package body Scng is -- the token used is Tok_Identifier. This allows to detect additional -- spaces added in sources when using the builder switch -m. - procedure Accumulate_Token_Checksum_Old; - -- Used in place of Accumulate_Token_Checksum for previous releases, when - -- Tok_Some was not included in Token_Type and the actual Token_Type was - -- used for keywords. This procedure is never used in the compiler or - -- gnatmake. - - procedure Accumulate_Token_Checksum_Old_Old; - -- Used in place of Accumulate_Token_Checksum for previous releases, when + procedure Accumulate_Token_Checksum_GNAT_6_3; + -- Used in place of Accumulate_Token_Checksum for GNAT versions 5.04 to + -- 6.3, when Tok_Some was not included in Token_Type and the actual + -- Token_Type was used for keywords. This procedure is never used in the + -- compiler or gnatmake, only in gprbuild. + + procedure Accumulate_Token_Checksum_GNAT_5_03; + -- Used in place of Accumulate_Token_Checksum for GNAT version 5.03, when -- Tok_Interface, Tok_Some, Tok_Synchronized and Tok_Overriding were not -- included in Token_Type and the actual Token_Type was used for keywords. - -- This procedure is never used in the compiler or gnatmake. + -- This procedure is never used in the compiler or gnatmake, only in + -- gprbuild. procedure Accumulate_Checksum (C : Character); pragma Inline (Accumulate_Checksum); @@ -135,11 +136,11 @@ package body Scng is Character'Val (Token_Type'Pos (Token))); end Accumulate_Token_Checksum; - ----------------------------------- - -- Accumulate_Token_Checksum_Old -- - ----------------------------------- + ---------------------------------------- + -- Accumulate_Token_Checksum_GNAT_6_3 -- + ---------------------------------------- - procedure Accumulate_Token_Checksum_Old is + procedure Accumulate_Token_Checksum_GNAT_6_3 is begin -- Individual values of Token_Type are used, instead of subranges, so -- that additions or suppressions of enumerated values in type @@ -189,13 +190,13 @@ package body Scng is (System.CRC32.CRC32 (Checksum), Character'Val (Token_Type'Pos (Token_Type'Pred (Token)))); end case; - end Accumulate_Token_Checksum_Old; + end Accumulate_Token_Checksum_GNAT_6_3; - --------------------------------------- - -- Accumulate_Token_Checksum_Old_Old -- - --------------------------------------- + ----------------------------------------- + -- Accumulate_Token_Checksum_GNAT_5_03 -- + ----------------------------------------- - procedure Accumulate_Token_Checksum_Old_Old is + procedure Accumulate_Token_Checksum_GNAT_5_03 is begin -- Individual values of Token_Type are used, instead of subranges, so -- that additions or suppressions of enumerated values in type @@ -254,7 +255,7 @@ package body Scng is (System.CRC32.CRC32 (Checksum), Character'Val (Token_Type'Pos (Token) - 4)); end case; - end Accumulate_Token_Checksum_Old_Old; + end Accumulate_Token_Checksum_GNAT_5_03; ---------------------------- -- Determine_Token_Casing -- @@ -891,7 +892,10 @@ package body Scng is end if; end if; - Accumulate_Token_Checksum; + if Checksum_Accumulate_Token_Checksum then + Accumulate_Token_Checksum; + end if; + return; end Nlit; @@ -2553,13 +2557,15 @@ package body Scng is -- Here is where we check if it was a keyword if Is_Keyword_Name (Token_Name) then - if Opt.Old_Checksums then + if Opt.Checksum_GNAT_6_3 then Token := Token_Type'Val (Get_Name_Table_Byte (Token_Name)); - if Opt.Old_Old_Checksums then - Accumulate_Token_Checksum_Old_Old; - else - Accumulate_Token_Checksum_Old; + if Checksum_Accumulate_Token_Checksum then + if Checksum_GNAT_5_03 then + Accumulate_Token_Checksum_GNAT_5_03; + else + Accumulate_Token_Checksum_GNAT_6_3; + end if; end if; else @@ -2622,7 +2628,10 @@ package body Scng is -- It is an identifier after all else - Accumulate_Token_Checksum; + if Checksum_Accumulate_Token_Checksum then + Accumulate_Token_Checksum; + end if; + Post_Scan; return; end if; |