From 3599a97bc3f0b10b87d450a7228cb86edffacabf Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Mon, 14 Oct 2013 12:47:59 +0000 Subject: prj-attr.adb: New attributes in package Clean: Artifacts_In_Exec_Dir, Artifacts_In_Object_Dir. 2013-10-14 Vincent Celier * 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 --- gcc/ada/prj-nmsc.adb | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'gcc/ada/prj-nmsc.adb') 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 => -- cgit v1.1