diff options
author | Thomas Quinot <quinot@adacore.com> | 2006-02-15 10:32:12 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-15 10:32:12 +0100 |
commit | 68e2ea275783d8b96d51913913fe88b4f61ee0c9 (patch) | |
tree | d3b7db1cb334e3cd4b6396c5d647f032daea89f5 /gcc/ada/scn.adb | |
parent | 6f301919dc530893fa43e994531ff347f955000a (diff) | |
download | gcc-68e2ea275783d8b96d51913913fe88b4f61ee0c9.zip gcc-68e2ea275783d8b96d51913913fe88b4f61ee0c9.tar.gz gcc-68e2ea275783d8b96d51913913fe88b4f61ee0c9.tar.bz2 |
ali-util.adb (Get_File_Checksum): Update to account for change in profile of Initialize_Scanner.
2006-02-13 Thomas Quinot <quinot@adacore.com>
Vincent Celier <celier@adacore.com>
Robert Dewar <dewar@adacore.com>
* ali-util.adb (Get_File_Checksum): Update to account for change in
profile of Initialize_Scanner.
* gprep.adb (Gnatprep): Update to account for change in profile of
Initialize_Scanner.
(Process_One_File): Same.
* lib.adb (Get_Code_Or_Source_Unit): New subprogram factoring the
common code between Get_Code_Unit and Get_Source_Unit. Reimplement
that behaviour using the new Unit information recorded in the source
files table, rather than going through all units every time.
(Get_Code_Unit): Reimplement in terms of Get_Code_Or_Source_Unit.
(Get_Source_Unit): Same.
* prepcomp.adb (Parse_Preprocessing_Data_File): Update to account for
change in profile of Initialize_Scanner.
(Prepare_To_Preprocess): Same.
* lib.ads: Fix typo in comment (templace -> template).
* prj-part.adb (Parse_Single_Project): Update to account for change in
profile of Initialize_Scanner.
* scn.adb (Initialize_Scanner): Account for change in profile of
Scng.Initialize_Scanner: set Current_Source_Unit in Scn instead of Scng.
Also record the association of the given Source_File_Index to the
corresponding Unit_Number_Type.
* scng.ads, scng.adb (Initialize_Scanner.Set_Reserved): Remove
procedure.
(Initialize_Scanner): Call Scans.Initialize_Ada_Keywords.
Remove Unit formal for generic scanner: this formal
is only relevant to Scn (the scanner instance used to parse Ada source
files), not to other instances. Update comment accordingly.
(Scan): Use new function Snames.Is_Keyword_Name.
* sinfo-cn.adb: Fix typo in comment.
* sinput.adb (Unit, Set_Unit): Accessors for new source file attribute
Unit.
* sinput.ads (Source_File_Record): New component Unit, used to capture
the unit identifier (if any) associated to a source file.
* sinput-c.adb, sinput-l.adb (Load_File): Initialize new component
Unit in Source_File_Record.
* sinput-p.adb (Source_File_Is_Subunit): Update to account for change
in profile of Initialize_Scanner.
* scans.adb (Initialize_Ada_Keywords): New procedure
* scans.ads (Initialize_Ada_Keywords): New procedure to initialize the
Ada keywords in the Namet table, without the need to call
Initialize_Scanner.
* snames.adb: Add pragma Ada_2005 (synonym for Ada_05)
(Is_Keyword_Name): New function
* snames.ads: Add subtype Configuration_Pragma_Names
Add pragma Ada_2005 (synonym for Ada_05)
(Is_Keyword_Name): New function
* snames.h: Add pragma Ada_2005 (synonym for Ada_05)
From-SVN: r111032
Diffstat (limited to 'gcc/ada/scn.adb')
-rw-r--r-- | gcc/ada/scn.adb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/scn.adb b/gcc/ada/scn.adb index 4a6f4f9..52a9fac 100644 --- a/gcc/ada/scn.adb +++ b/gcc/ada/scn.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -281,7 +281,13 @@ package body Scn is GNAT_Hedr : constant Text_Buffer (1 .. 78) := (others => '-'); begin - Scanner.Initialize_Scanner (Unit, Index); + Scanner.Initialize_Scanner (Index); + + if Index /= Internal_Source_File then + Set_Unit (Index, Unit); + end if; + + Current_Source_Unit := Unit; -- Set default for Comes_From_Source (except if we are going to process -- an artificial string internally created within the compiler and |