diff options
author | Vincent Celier <celier@adacore.com> | 2013-10-14 12:47:59 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-14 14:47:59 +0200 |
commit | 3599a97bc3f0b10b87d450a7228cb86edffacabf (patch) | |
tree | fd4f007ccf3307a8d3eba23929fc847e666f6caf | |
parent | f7ea2603f6c28fa91fbf2bf5f79cb2d04cec61c7 (diff) | |
download | gcc-3599a97bc3f0b10b87d450a7228cb86edffacabf.zip gcc-3599a97bc3f0b10b87d450a7228cb86edffacabf.tar.gz gcc-3599a97bc3f0b10b87d450a7228cb86edffacabf.tar.bz2 |
prj-attr.adb: New attributes in package Clean: Artifacts_In_Exec_Dir, Artifacts_In_Object_Dir.
2013-10-14 Vincent Celier <celier@adacore.com>
* prj-attr.adb: New attributes in package Clean:
Artifacts_In_Exec_Dir, Artifacts_In_Object_Dir.
* prj-nmsc.adb (Process_Clean (Attributes)): New
procedure to process attributes Artifacts_In_Exec_Dir and
Artifacts_In_Object_Dir in package Clean.
* prj.ads (Project_Configuration): New components
Artifacts_In_Exec_Dir and Artifacts_In_Object_Dir.
* snames.ads-tmpl: New standard names Artifacts_In_Exec_Dir and
Artifacts_In_Object_Dir used only by gprclean.
From-SVN: r203529
-rw-r--r-- | gcc/ada/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/ada/prj-attr.adb | 2 | ||||
-rw-r--r-- | gcc/ada/prj-nmsc.adb | 53 | ||||
-rw-r--r-- | gcc/ada/prj.ads | 15 | ||||
-rw-r--r-- | gcc/ada/snames.ads-tmpl | 4 |
5 files changed, 84 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6c33943..ce45076 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2013-10-14 Vincent Celier <celier@adacore.com> + + * prj-attr.adb: New attributes in package Clean: + Artifacts_In_Exec_Dir, Artifacts_In_Object_Dir. + * prj-nmsc.adb (Process_Clean (Attributes)): New + procedure to process attributes Artifacts_In_Exec_Dir and + Artifacts_In_Object_Dir in package Clean. + * prj.ads (Project_Configuration): New components + Artifacts_In_Exec_Dir and Artifacts_In_Object_Dir. + * snames.ads-tmpl: New standard names Artifacts_In_Exec_Dir and + Artifacts_In_Object_Dir used only by gprclean. + 2013-10-14 Robert Dewar <dewar@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Add error diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index a692811..586fc4f 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -288,6 +288,8 @@ package body Prj.Attr is "LVswitches#" & "Lasource_artifact_extensions#" & "Laobject_artifact_extensions#" & + "LVartifacts_in_exec_dir#" & + "LVartifacts_in_object_dir#" & -- package Cross_Reference diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index f1538de..12a84e5 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -1127,6 +1127,9 @@ package body Prj.Nmsc is procedure Process_Builder (Attributes : Variable_Id); -- Process the simple attributes of package Builder + procedure Process_Clean (Attributes : Variable_Id); + -- Process the simple attributes of package Clean + procedure Process_Clean (Arrays : Array_Id); -- Process the associated array attributes of package Clean @@ -1256,6 +1259,55 @@ package body Prj.Nmsc is -- Process_Clean -- ------------------- + procedure Process_Clean (Attributes : Variable_Id) is + Attribute_Id : Variable_Id; + Attribute : Variable; + List : String_List_Id; + + begin + -- Process non associated array attributes from package Clean + + Attribute_Id := Attributes; + while Attribute_Id /= No_Variable loop + Attribute := Shared.Variable_Elements.Table (Attribute_Id); + + if not Attribute.Value.Default then + if Attribute.Name = Name_Artifacts_In_Exec_Dir then + + -- Attribute Artifacts_In_Exec_Dir: the list of file + -- names to be cleaned in the exec dir of the main + -- project. + + List := Attribute.Value.Values; + + if List /= Nil_String then + Put (Into_List => + Project.Config.Artifacts_In_Exec_Dir, + From_List => List, + In_Tree => Data.Tree); + end if; + + elsif Attribute.Name = Name_Artifacts_In_Object_Dir then + + -- Attribute Artifacts_In_Exec_Dir: the list of file + -- names to be cleaned in the object dir of every + -- project. + + List := Attribute.Value.Values; + + if List /= Nil_String then + Put (Into_List => + Project.Config.Artifacts_In_Object_Dir, + From_List => List, + In_Tree => Data.Tree); + end if; + end if; + end if; + + Attribute_Id := Attribute.Next; + end loop; + end Process_Clean; + procedure Process_Clean (Arrays : Array_Id) is Current_Array_Id : Array_Id; Current_Array : Array_Data; @@ -1932,6 +1984,7 @@ package body Prj.Nmsc is -- Process attributes of package Clean + Process_Clean (Element.Decl.Attributes); Process_Clean (Element.Decl.Arrays); when Name_Compiler => diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index 66f8786..a1da52b 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -1133,6 +1133,17 @@ package Prj is Auto_Init_Supported : Boolean := False; -- True if automatic initialisation is supported for shared stand-alone -- libraries. + + -- Cleaning + + Artifacts_In_Exec_Dir : Name_List_Index := No_Name_List; + -- List of regexp file names to be cleaned in the exec directory of the + -- main project. + + Artifacts_In_Object_Dir : Name_List_Index := No_Name_List; + -- List of regexp file names to be cleaned in the object directory of + -- all projects. + end record; Default_Project_Config : constant Project_Configuration := @@ -1167,7 +1178,9 @@ package Prj is Lib_Version_Options => No_Name_List, Symbolic_Link_Supported => False, Lib_Maj_Min_Id_Supported => False, - Auto_Init_Supported => False); + Auto_Init_Supported => False, + Artifacts_In_Exec_Dir => No_Name_List, + Artifacts_In_Object_Dir => No_Name_List); ------------------------- -- Aggregated projects -- diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index c5c4cda..69eb42e 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -1221,7 +1221,7 @@ package Snames is -- Additional reserved words and identifiers used in GNAT Project Files -- Note that Name_External is already previously declared. - -- The names with the -- GB annotation are only used in gprbuild. + -- Names with a -- GB annotation are only used in gprbuild or gprclean Name_Active : constant Name_Id := N + $; Name_Aggregate : constant Name_Id := N + $; @@ -1229,6 +1229,8 @@ package Snames is Name_Archive_Builder_Append_Option : constant Name_Id := N + $; Name_Archive_Indexer : constant Name_Id := N + $; Name_Archive_Suffix : constant Name_Id := N + $; + Name_Artifacts_In_Exec_Dir : constant Name_Id := N + $; -- GB + Name_Artifacts_In_Object_Dir : constant Name_Id := N + $; -- GB Name_Binder : constant Name_Id := N + $; Name_Body_Suffix : constant Name_Id := N + $; Name_Builder : constant Name_Id := N + $; |