===================================================================
@@ -1556,7 +1556,6 @@ package body Clean is
-- Initialize some packages
Csets.Initialize;
- Namet.Initialize;
Snames.Initialize;
Project_Node_Tree := new Project_Node_Tree_Data;
===================================================================
@@ -610,7 +610,6 @@ begin
Uintp.Initialize;
Urealp.Initialize;
Errout.Initialize;
- Namet.Initialize;
SCOs.Initialize;
Snames.Initialize;
Stringt.Initialize;
===================================================================
@@ -583,13 +583,11 @@ begin
Osint.Add_Default_Search_Dirs;
-- Carry out package initializations. These are initializations which
- -- might logically be performed at elaboration time, but Namet at least
- -- can't be done that way (because it is used in the Compiler), and we
- -- decide to be consistent. Like elaboration, the order in which these
- -- calls are made is in some cases important.
+ -- might logically be performed at elaboration time, and we decide to be
+ -- consistent. Like elaboration, the order in which these calls are made
+ -- is in some cases important.
Csets.Initialize;
- Namet.Initialize;
Snames.Initialize;
-- Acquire target parameters
===================================================================
@@ -1320,9 +1320,7 @@ procedure GNATCmd is
begin
-- Initializations
- Namet.Initialize;
Csets.Initialize;
-
Snames.Initialize;
Project_Node_Tree := new Project_Node_Tree_Data;
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 1996-2010, 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- --
@@ -1537,7 +1537,6 @@ begin
-- Initialize packages to be used
- Namet.Initialize;
Csets.Initialize;
Snames.Initialize;
@@ -1561,7 +1560,6 @@ begin
-- the binder generated file
if Compile_Bind_File and then Standard_Gcc then
-
Initialize_ALI;
Name_Len := Ali_File_Name'Length;
Name_Buffer (1 .. Name_Len) := Ali_File_Name.all;
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 1992-2010, 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- --
@@ -1524,7 +1524,6 @@ procedure Gnatls is
begin
-- Initialize standard packages
- Namet.Initialize;
Csets.Initialize;
Snames.Initialize;
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 2002-2010, 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- --
@@ -172,7 +172,6 @@ package body GPrep is
-- Do some initializations (order is important here!)
Csets.Initialize;
- Namet.Initialize;
Snames.Initialize;
Stringt.Initialize;
Prep.Initialize;
===================================================================
@@ -6725,7 +6725,7 @@ package body Make is
Check_Object_Consistency := True;
- -- Package initializations. The order of calls is important here
+ -- Package initializations (the order of calls is important here)
Output.Set_Standard_Error;
@@ -6734,8 +6734,6 @@ package body Make is
Linker_Switches.Init;
Csets.Initialize;
- Namet.Initialize;
-
Snames.Initialize;
Prj.Initialize (Project_Tree);
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 1992-2010, 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- --
@@ -864,29 +864,7 @@ package body Namet is
procedure Initialize is
begin
- Name_Chars.Init;
- Name_Entries.Init;
-
- -- Initialize entries for one character names
-
- for C in Character loop
- Name_Entries.Append
- ((Name_Chars_Index => Name_Chars.Last,
- Name_Len => 1,
- Byte_Info => 0,
- Int_Info => 0,
- Name_Has_No_Encodings => True,
- Hash_Link => No_Name));
-
- Name_Chars.Append (C);
- Name_Chars.Append (ASCII.NUL);
- end loop;
-
- -- Clear hash table
-
- for J in Hash_Index_Type loop
- Hash_Table (J) := No_Name;
- end loop;
+ null;
end Initialize;
----------------------
@@ -1133,6 +1111,37 @@ package body Namet is
end if;
end Name_Find;
+ ------------------
+ -- Reinitialize --
+ ------------------
+
+ procedure Reinitialize is
+ begin
+ Name_Chars.Init;
+ Name_Entries.Init;
+
+ -- Initialize entries for one character names
+
+ for C in Character loop
+ Name_Entries.Append
+ ((Name_Chars_Index => Name_Chars.Last,
+ Name_Len => 1,
+ Byte_Info => 0,
+ Int_Info => 0,
+ Name_Has_No_Encodings => True,
+ Hash_Link => No_Name));
+
+ Name_Chars.Append (C);
+ Name_Chars.Append (ASCII.NUL);
+ end loop;
+
+ -- Clear hash table
+
+ for J in Hash_Index_Type loop
+ Hash_Table (J) := No_Name;
+ end loop;
+ end Reinitialize;
+
----------------------
-- Reset_Name_Table --
----------------------
@@ -1399,4 +1408,8 @@ package body Namet is
end if;
end Write_Name_Decoded;
+-- Package initialization, initialize tables
+
+begin
+ Reinitialize;
end Namet;
===================================================================
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
+-- Copyright (C) 1992-2010, 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- --
@@ -239,14 +239,20 @@ package Namet is
-- is, it starts with an upper case O).
procedure Initialize;
- -- Initializes the names table, including initializing the first 26
- -- entries in the table (for the 1-character lower case names a-z) Note
- -- that Initialize must not be called if Tree_Read is used.
+ -- This is a dummy procedure. It is retained for easy compatibility with
+ -- clients who used to call Initialize when this call was required. Now
+ -- initialization is performed automatically during package elaboration.
+ -- Note that this change fixes problems which existed prior to the change
+ -- of Initialize being called more than once. See also Reinitialize which
+ -- allows reinitialiation of the tables.
procedure Lock;
-- Lock name tables before calling back end. We reserve some extra space
-- before locking to avoid unnecessary inefficiencies when we unlock.
+ procedure Reinitialize;
+ -- Clears the name tables and removes all existing entries from the table.
+
procedure Unlock;
-- Unlocks the name table to allow use of the extra space reserved by the
-- call to Lock. See gnat1drv for details of the need for this.
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 2001-2010, 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- --
@@ -792,7 +792,6 @@ package body Prj.Makr is
-- Do some needed initializations
Csets.Initialize;
- Namet.Initialize;
Snames.Initialize;
Prj.Initialize (No_Project_Tree);
Prj.Tree.Initialize (Tree);