aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/scng.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-04-01 12:04:40 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-04-01 12:04:40 +0200
commit6b6fcd3ead62875b86a999a28c070bc88ef37d6e (patch)
treeb338d3df4e73cbb9b9be4f8a5366b15275287114 /gcc/ada/scng.adb
parent2ae6e9823a58bd58377b48e7a412575f1a08c585 (diff)
downloadgcc-6b6fcd3ead62875b86a999a28c070bc88ef37d6e.zip
gcc-6b6fcd3ead62875b86a999a28c070bc88ef37d6e.tar.gz
gcc-6b6fcd3ead62875b86a999a28c070bc88ef37d6e.tar.bz2
[multiple changes]
2004-04-01 Robert Dewar <dewar@gnat.com> * checks.adb: Minor reformatting throughout Note that prev checkin added RM reference to alignment warning 2004-04-01 Ed Schonberg <schonberg@gnat.com> * exp_aggr.adb (Get_Component_Val): Treat a string literal as non-static when building aggregate for bit-packed array. * exp_ch4.adb (Expand_N_Slice): If a packed slice is an actual of a function call that is itself the actual in a procedure call, build temporary for it. * exp_pakd.adb (Expand_Bit_Packed_Element_Set): If right-hand side is a string literal, create a temporary for it, constant folding only handles scalars here. 2004-04-01 Vincent Celier <celier@gnat.com> * ali-util.adb (Post_Scan, Error_Msg, Error_Msg_S, Error_Msg_SC, Error_Msg_SP): New empty procedures to instantiate the Scanner. (Style, Scanner): Instantiations of Styleg and Scng to be able to scan tokens. (Accumulate_Checksum, Initialize_Checksum): Remove procedures. (Get_File_Checksum): Use the instantiated scanner to scan all the tokens and get the checksum. * make.adb (Gnatmake): Do not insert into Q the Main_Source if it is already in the Q. Increase the Marking_Label at the end of the Multiple_Main_Loop, instead of at the beginning. * osint.adb (Lib_File_Name): Use Multi_Unit_Index_Character, not '~' directly. (Osint package elaboration): Change Multi_Unit_Index_Character to '$' if on VMS. * osint.ads (Multi_Unit_Index_Character): New Character global variable * osint-c.adb (Set_Library_Info_Name): Use Multi_Unit_Index_Character, not '~' directly. * par.adb: Remove test on file name to detect language defined units. Add test on unit name, after parsing, to detect language defined units that are not compiled with -gnatg (except System.RPC and its children) * par-ch10.adb (P_Compilation_Unit): In multi-unit sources, scan the following units without style checking. * switch-c.adb: Change -gnatC to -gnateI * usage.adb: Document new switch -gnateInnn * scng.adb (Accumulate_Token_Checksum): New procedure (Scan): Call Accumulate_Token_Checksum after each identifier, reserved word or literal number. (Scan.Nlit.Scan_Integer): Do not accumulate internal '_' in litteral numbers. 2004-04-01 Thomas Quinot <quinot@act-europe.fr> * a-tasatt.adb, g-comlin.adb, sinput-c.adb, s-secsta.adb, s-tpobop.adb, switch-m.adb, 56taprop.adb, 5ginterr.adb, 5gmastop.adb, 5staprop.adb, 5vinterr.adb, 5vtaprop.adb, 5vtpopde.adb, 5vtpopde.adb: Add missing 'constant' keywords. 2004-04-01 Javier Miranda <miranda@gnat.com> * par-ch4.adb: (P_Allocator): Code cleanup * sem_ch3.adb (Access_Definition): Properly set the null-excluding attribute. * sinfo.ads: Complete documentation of previous change 2004-04-01 GNAT Script <nobody@gnat.com> * Make-lang.in: Makefile automatically updated 2004-04-01 Pascal Obry <obry@gnat.com> * gnatlink.adb (Process_Binder_File): Remove duplicate linker options only on VMS. This special handling was done because an old GNU/ld bug on Windows which has been fixed. From-SVN: r80290
Diffstat (limited to 'gcc/ada/scng.adb')
-rw-r--r--gcc/ada/scng.adb25
1 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb
index f0189c1..690656c 100644
--- a/gcc/ada/scng.adb
+++ b/gcc/ada/scng.adb
@@ -59,6 +59,9 @@ package body Scng is
-- Local Subprograms --
-----------------------
+ procedure Accumulate_Token_Checksum;
+ pragma Inline (Accumulate_Token_Checksum);
+
procedure Accumulate_Checksum (C : Character);
pragma Inline (Accumulate_Checksum);
-- This routine accumulates the checksum given character C. During the
@@ -96,6 +99,17 @@ package body Scng is
Accumulate_Checksum (Character'Val (C mod 256));
end Accumulate_Checksum;
+ -------------------------------
+ -- Accumulate_Token_Checksum --
+ -------------------------------
+
+ procedure Accumulate_Token_Checksum is
+ begin
+ System.CRC32.Update
+ (System.CRC32.CRC32 (Checksum),
+ Character'Val (Token_Type'Pos (Token)));
+ end Accumulate_Token_Checksum;
+
----------------------------
-- Determine_Token_Casing --
----------------------------
@@ -408,6 +422,7 @@ package body Scng is
-- Procedure to scan integer literal. On entry, Scan_Ptr points to
-- a digit, on exit Scan_Ptr points past the last character of
-- the integer.
+ --
-- For each digit encountered, UI_Int_Value is multiplied by 10,
-- and the value of the digit added to the result. In addition,
-- the value in Scale is decremented by one for each actual digit
@@ -444,7 +459,10 @@ package body Scng is
C := Source (Scan_Ptr);
if C = '_' then
- Accumulate_Checksum ('_');
+ -- We do not want to accumulate the '_' in the checksum,
+ -- so that 1_234 is equivalent to 1234, and does not
+ -- trigger compilation in "minimal recompilation"
+ -- (gnatmake -m).
loop
Scan_Ptr := Scan_Ptr + 1;
@@ -707,6 +725,8 @@ package body Scng is
end if;
+ Accumulate_Token_Checksum;
+
return;
end Nlit;
@@ -2063,16 +2083,19 @@ package body Scng is
-- of the corresponding keyword.
Token_Name := No_Name;
+ Accumulate_Token_Checksum;
return;
-- It is an identifier after all
else
Token := Tok_Identifier;
+ Accumulate_Token_Checksum;
Post_Scan;
return;
end if;
end Scan;
+
--------------------------
-- Set_Comment_As_Token --
--------------------------