Commit 1d7d0be6 by Vincent Celier Committed by Arnaud Charlet

prj-attr.adb: Add new attribute Excluded_Source_Files

2007-08-31  Vincent Celier  <celier@adacore.com>

	* prj-attr.adb: Add new attribute Excluded_Source_Files

	* prj-nmsc.adb: Use attribute Excluded_Source_Files before
	Locally_Removed_Files.

	* snames.ads, snames.adb: New standard name Excluded_Source_Files

From-SVN: r127978
parent b54ddf5a
...@@ -75,12 +75,13 @@ package body Prj.Attr is ...@@ -75,12 +75,13 @@ package body Prj.Attr is
"SVobject_dir#" & "SVobject_dir#" &
"SVexec_dir#" & "SVexec_dir#" &
"LVsource_dirs#" & "LVsource_dirs#" &
"LVremoved_source_dirs#" & "LVexcluded_source_dirs#" &
-- Source files -- Source files
"LVsource_files#" & "LVsource_files#" &
"LVlocally_removed_files#" & "LVlocally_removed_files#" &
"LVexcluded_source_files#" &
"SVsource_list_file#" & "SVsource_list_file#" &
-- Libraries -- Libraries
......
...@@ -4812,9 +4812,9 @@ package body Prj.Nmsc is ...@@ -4812,9 +4812,9 @@ package body Prj.Nmsc is
Util.Value_Of Util.Value_Of
(Name_Source_Dirs, Data.Decl.Attributes, In_Tree); (Name_Source_Dirs, Data.Decl.Attributes, In_Tree);
Removed_Source_Dirs : constant Variable_Value := Excluded_Source_Dirs : constant Variable_Value :=
Util.Value_Of Util.Value_Of
(Name_Removed_Source_Dirs, (Name_Excluded_Source_Dirs,
Data.Decl.Attributes, Data.Decl.Attributes,
In_Tree); In_Tree);
...@@ -5416,12 +5416,13 @@ package body Prj.Nmsc is ...@@ -5416,12 +5416,13 @@ package body Prj.Nmsc is
else else
declare declare
Source_Dir : String_List_Id := Source_Dirs.Values; Source_Dir : String_List_Id;
Element : String_Element; Element : String_Element;
begin begin
-- Process the source directories for each element of the list -- Process the source directories for each element of the list
Source_Dir := Source_Dirs.Values;
while Source_Dir /= Nil_String loop while Source_Dir /= Nil_String loop
Element := Element :=
In_Tree.String_Elements.Table (Source_Dir); In_Tree.String_Elements.Table (Source_Dir);
...@@ -5432,8 +5433,9 @@ package body Prj.Nmsc is ...@@ -5432,8 +5433,9 @@ package body Prj.Nmsc is
end; end;
end if; end if;
if (not Removed_Source_Dirs.Default) and then if not Excluded_Source_Dirs.Default
Removed_Source_Dirs.Values /= Nil_String then and then Excluded_Source_Dirs.Values /= Nil_String
then
declare declare
Source_Dir : String_List_Id; Source_Dir : String_List_Id;
Element : String_Element; Element : String_Element;
...@@ -5441,7 +5443,7 @@ package body Prj.Nmsc is ...@@ -5441,7 +5443,7 @@ package body Prj.Nmsc is
begin begin
-- Process the source directories for each element of the list -- Process the source directories for each element of the list
Source_Dir := Removed_Source_Dirs.Values; Source_Dir := Excluded_Source_Dirs.Values;
while Source_Dir /= Nil_String loop while Source_Dir /= Nil_String loop
Element := Element :=
In_Tree.String_Elements.Table (Source_Dir); In_Tree.String_Elements.Table (Source_Dir);
...@@ -6883,9 +6885,9 @@ package body Prj.Nmsc is ...@@ -6883,9 +6885,9 @@ package body Prj.Nmsc is
Data.Decl.Attributes, Data.Decl.Attributes,
In_Tree); In_Tree);
Locally_Removed : constant Variable_Value := Excluded_Sources : Variable_Value :=
Util.Value_Of Util.Value_Of
(Name_Locally_Removed_Files, (Name_Excluded_Source_Files,
Data.Decl.Attributes, Data.Decl.Attributes,
In_Tree); In_Tree);
...@@ -7008,13 +7010,24 @@ package body Prj.Nmsc is ...@@ -7008,13 +7010,24 @@ package body Prj.Nmsc is
(Project, In_Tree, Data, Follow_Links); (Project, In_Tree, Data, Follow_Links);
end if; end if;
-- If Excluded_ource_Files is not declared, check
-- Locally_Removed_Files.
if Excluded_Sources.Default then
Excluded_Sources :=
Util.Value_Of
(Name_Locally_Removed_Files,
Data.Decl.Attributes,
In_Tree);
end if;
-- If there are sources that are locally removed, mark them as -- If there are sources that are locally removed, mark them as
-- such in the Units table. -- such in the Units table.
if not Locally_Removed.Default then if not Excluded_Sources.Default then
declare declare
Current : String_List_Id := Locally_Removed.Values; Current : String_List_Id := Excluded_Sources.Values;
Element : String_Element; Element : String_Element;
Location : Source_Ptr; Location : Source_Ptr;
OK : Boolean; OK : Boolean;
...@@ -7030,10 +7043,10 @@ package body Prj.Nmsc is ...@@ -7030,10 +7043,10 @@ package body Prj.Nmsc is
Name := Name_Find; Name := Name_Find;
-- If the element has no location, then use the location -- If the element has no location, then use the location
-- of Locally_Removed to report possible errors. -- of Excluded_Sources to report possible errors.
if Element.Location = No_Location then if Element.Location = No_Location then
Location := Locally_Removed.Location; Location := Excluded_Sources.Location;
else else
Location := Element.Location; Location := Element.Location;
end if; end if;
...@@ -7409,14 +7422,25 @@ package body Prj.Nmsc is ...@@ -7409,14 +7422,25 @@ package body Prj.Nmsc is
Data.Decl.Attributes, Data.Decl.Attributes,
In_Tree); In_Tree);
Locally_Removed : constant Variable_Value := Excluded_Sources : Variable_Value :=
Util.Value_Of Util.Value_Of
(Name_Locally_Removed_Files, (Name_Excluded_Source_Files,
Data.Decl.Attributes, Data.Decl.Attributes,
In_Tree); In_Tree);
Name_Loc : Name_Location; Name_Loc : Name_Location;
begin begin
-- If Excluded_ource_Files is not declared, check
-- Locally_Removed_Files.
if Excluded_Sources.Default then
Excluded_Sources :=
Util.Value_Of
(Name_Locally_Removed_Files,
Data.Decl.Attributes,
In_Tree);
end if;
if not Sources.Default then if not Sources.Default then
if not Source_List_File.Default then if not Source_List_File.Default then
Error_Msg Error_Msg
...@@ -7517,7 +7541,7 @@ package body Prj.Nmsc is ...@@ -7517,7 +7541,7 @@ package body Prj.Nmsc is
-- If there are locally removed sources, mark them as such -- If there are locally removed sources, mark them as such
if not Locally_Removed.Default then if not Excluded_Sources.Default then
declare declare
Current : String_List_Id; Current : String_List_Id;
Element : String_Element; Element : String_Element;
...@@ -7528,7 +7552,7 @@ package body Prj.Nmsc is ...@@ -7528,7 +7552,7 @@ package body Prj.Nmsc is
Src_Data : Source_Data; Src_Data : Source_Data;
begin begin
Current := Locally_Removed.Values; Current := Excluded_Sources.Values;
while Current /= Nil_String loop while Current /= Nil_String loop
Element := Element :=
In_Tree.String_Elements.Table (Current); In_Tree.String_Elements.Table (Current);
...@@ -7537,10 +7561,10 @@ package body Prj.Nmsc is ...@@ -7537,10 +7561,10 @@ package body Prj.Nmsc is
Name := Name_Find; Name := Name_Find;
-- If the element has no location, then use the location -- If the element has no location, then use the location
-- of Locally_Removed to report possible errors. -- of Excluded_Sources to report possible errors.
if Element.Location = No_Location then if Element.Location = No_Location then
Location := Locally_Removed.Location; Location := Excluded_Sources.Location;
else else
Location := Element.Location; Location := Element.Location;
end if; end if;
......
...@@ -695,6 +695,8 @@ package body Snames is ...@@ -695,6 +695,8 @@ package body Snames is
"dependency_file_kind#" & "dependency_file_kind#" &
"dependency_switches#" & "dependency_switches#" &
"driver#" & "driver#" &
"excluded_source_dirs#" &
"excluded_source_files#" &
"exec_dir#" & "exec_dir#" &
"executable#" & "executable#" &
"executable_suffix#" & "executable_suffix#" &
...@@ -753,7 +755,6 @@ package body Snames is ...@@ -753,7 +755,6 @@ package body Snames is
"prefix#" & "prefix#" &
"project#" & "project#" &
"roots#" & "roots#" &
"removed_source_dirs#" &
"required_switches#" & "required_switches#" &
"run_path_option#" & "run_path_option#" &
"runtime_project#" & "runtime_project#" &
......
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