Commit 812f574f by Arnaud Charlet

[multiple changes]

2009-04-08  Tristan Gingold  <gingold@adacore.com>

	* sem_prag.adb: Restrict pragma Thread_Local_Storage to library level
	variables.
	Set Has_Gigi_Rep_Item flag to TLS variables (to ease gigi work).

2009-04-08  Vincent Celier  <celier@adacore.com>

	* prj-nmsc.adb:
	(Add_Source): Add the mapping of the unit name to source file name in
	the Unit_Sources_HT hash table, if the unit name is not null.

	* prj.adb (Reset): Reset hash table Tree.Unit_Sources_HT

	* prj.ads (Unit_Sources_Htable): New hash table instantiation
	(Project_Tree_Data): New component Unit_Sources_HT

From-SVN: r145728
parent 020e3d02
2009-04-08 Tristan Gingold <gingold@adacore.com>
* sem_prag.adb: Restrict pragma Thread_Local_Storage to library level
variables.
Set Has_Gigi_Rep_Item flag to TLS variables (to ease gigi work).
2009-04-08 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb:
(Add_Source): Add the mapping of the unit name to source file name in
the Unit_Sources_HT hash table, if the unit name is not null.
* prj.adb (Reset): Reset hash table Tree.Unit_Sources_HT
* prj.ads (Unit_Sources_Htable): New hash table instantiation
(Project_Tree_Data): New component Unit_Sources_HT
2009-04-08 Thomas Quinot <quinot@adacore.com>
* sem_ch8.adb: Minor reformatting.
......@@ -656,6 +656,13 @@ package body Prj.Nmsc is
Source_Paths_Htable.Set (In_Tree.Source_Paths_HT, Path, Id);
end if;
-- Add the source id to the Unit_Sources_HT hash table, if the unit name
-- is not null.
if Unit /= No_Name then
Unit_Sources_Htable.Set (In_Tree.Unit_Sources_HT, Unit, Id);
end if;
-- Add the source to the global list
Src_Data.Next_In_Sources := In_Tree.First_Source;
......@@ -808,6 +815,7 @@ package body Prj.Nmsc is
declare
Src_Data : Source_Data renames
In_Tree.Sources.Table (Source);
begin
exit Source_Loop when Src_Data.Language = Language;
......@@ -2543,6 +2551,7 @@ package body Prj.Nmsc is
declare
Src_Data : Source_Data renames
In_Tree.Sources.Table (Source);
begin
if Src_Data.File = Name then
if not Src_Data.Locally_Removed then
......@@ -2605,6 +2614,7 @@ package body Prj.Nmsc is
declare
Src_Data : Source_Data renames
In_Tree.Sources.Table (Source);
begin
if not Src_Data.Declared_In_Interfaces then
Src_Data.In_Interfaces := False;
......@@ -2634,8 +2644,10 @@ package body Prj.Nmsc is
-- Check that a list of unit names contains only valid names
procedure Get_Exceptions (Kind : Source_Kind);
-- Comment required ???
procedure Get_Unit_Exceptions (Kind : Source_Kind);
-- Comment required ???
----------------------
-- Check_Unit_Names --
......@@ -3553,12 +3565,10 @@ package body Prj.Nmsc is
Src_Id := Proj_Data.First_Source;
while Src_Id /= No_Source loop
declare
Src : Source_Data renames
In_Tree.Sources.Table (Src_Id);
Src : Source_Data renames In_Tree.Sources.Table (Src_Id);
begin
exit when Src.Lang_Kind /= File_Based
or else Src.Kind /= Spec;
Src_Id := Src.Next_In_Project;
end;
end loop;
......@@ -7402,8 +7412,8 @@ package body Prj.Nmsc is
declare
Src_Data : Source_Data renames
In_Tree.Sources.Table (Source);
begin
begin
if Src_Data.Naming_Exception
and then Src_Data.Path = No_Path_Information
then
......@@ -8481,12 +8491,10 @@ package body Prj.Nmsc is
Source := Data.First_Source;
while Source /= No_Source loop
declare
Src_Data : Source_Data renames
In_Tree.Sources.Table (Source);
Src_Data : Source_Data renames In_Tree.Sources.Table (Source);
begin
-- A file that is excluded cannot also be an exception file
-- name
-- An excluded file cannot also be an exception file name
if Excluded_Sources_Htable.Get (Src_Data.File) /=
No_File_Found
......@@ -8514,8 +8522,7 @@ package body Prj.Nmsc is
Source_Names.Set (K => Src_Data.File, E => Name_Loc);
-- If this is an Ada exception, record it in table
-- Unit_Exceptions
-- If this is an Ada exception, record in table Unit_Exceptions
if Src_Data.Unit /= No_Name then
declare
......@@ -8548,7 +8555,6 @@ package body Prj.Nmsc is
while FF /= No_File_Found loop
OK := False;
Source := In_Tree.First_Source;
while Source /= No_Source loop
declare
Src_Data : Source_Data renames
......@@ -8659,7 +8665,6 @@ package body Prj.Nmsc is
Sinput.P.Load_Project_File
(Get_Name_String
(Src_Data.Path.Name));
begin
if Sinput.P.Source_File_Is_Subunit
(Src_Ind)
......
......@@ -857,6 +857,7 @@ package body Prj is
Units_Htable.Reset (Tree.Units_HT);
Files_Htable.Reset (Tree.Files_HT);
Source_Paths_Htable.Reset (Tree.Source_Paths_HT);
Unit_Sources_Htable.Reset (Tree.Unit_Sources_HT);
-- Private part table
......
......@@ -804,6 +804,14 @@ package Prj is
Equal => "=");
-- Mapping of source paths to source ids
package Unit_Sources_Htable is new Simple_HTable
(Header_Num => Header_Num,
Element => Source_Id,
No_Element => No_Source,
Key => Name_Id,
Hash => Hash,
Equal => "=");
type Verbosity is (Default, Medium, High);
-- Verbosity when parsing GNAT Project Files
-- Default is default (very quiet, if no errors).
......@@ -1464,6 +1472,7 @@ package Prj is
Units_HT : Units_Htable.Instance;
Files_HT : Files_Htable.Instance;
Source_Paths_HT : Source_Paths_Htable.Instance;
Unit_Sources_HT : Unit_Sources_Htable.Instance;
-- Private part
......
......@@ -11253,7 +11253,7 @@ package body Sem_Prag is
GNAT_Pragma;
Check_Arg_Count (1);
Check_Optional_Identifier (Arg1, Name_Entity);
Check_Arg_Is_Local_Name (Arg1);
Check_Arg_Is_Library_Level_Local_Name (Arg1);
Id := Expression (Arg1);
Analyze (Id);
......@@ -11273,6 +11273,7 @@ package body Sem_Prag is
end if;
Set_Has_Pragma_Thread_Local_Storage (E);
Set_Has_Gigi_Rep_Item (E);
end Thread_Local_Storage;
----------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment