diff options
Diffstat (limited to 'gcc/ada/prj-attr.adb')
-rw-r--r-- | gcc/ada/prj-attr.adb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index 0f3fef4a722..c340b293244 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -260,6 +260,12 @@ package body Prj.Attr is "Ladefault_switches#" & "Lbswitches#" & + -- package Synchronize + + "Psynchronize#" & + "Ladefault_switches#" & + "Lbswitches#" & + -- package Eliminate "Peliminate#" & @@ -296,9 +302,38 @@ package body Prj.Attr is Initialized : Boolean := False; -- A flag to avoid multiple initialization + Package_Names : String_List_Access := new Strings.String_List (1 .. 20); + Last_Package_Name : Natural := 0; + -- Package_Names (1 .. Last_Package_Name) contains the list of the known + -- package names, coming from the Initialization_Data string or from + -- calls to one of the two procedures Register_New_Package. + + procedure Add_Package_Name (Name : String); + -- Add a package name in the Package_Name list, extending it, if necessary + function Name_Id_Of (Name : String) return Name_Id; -- Returns the Name_Id for Name in lower case + ---------------------- + -- Add_Package_Name -- + ---------------------- + + procedure Add_Package_Name (Name : String) is + begin + if Last_Package_Name = Package_Names'Last then + declare + New_List : constant Strings.String_List_Access := + new Strings.String_List (1 .. Package_Names'Last * 2); + begin + New_List (Package_Names'Range) := Package_Names.all; + Package_Names := New_List; + end; + end if; + + Last_Package_Name := Last_Package_Name + 1; + Package_Names (Last_Package_Name) := new String'(Name); + end Add_Package_Name; + ----------------------- -- Attribute_Kind_Of -- ----------------------- @@ -433,6 +468,8 @@ package body Prj.Attr is First_Attribute => Empty_Attr); Start := Finish + 1; + Add_Package_Name (Get_Name_String (Package_Name)); + when 'S' => Var_Kind := Single; Optional_Index := False; @@ -594,6 +631,15 @@ package body Prj.Attr is end if; end Optional_Index_Of; + ----------------------- + -- Package_Name_List -- + ----------------------- + + function Package_Name_List return Strings.String_List is + begin + return Package_Names (1 .. Last_Package_Name); + end Package_Name_List; + ------------------------ -- Package_Node_Id_Of -- ------------------------ @@ -729,6 +775,8 @@ package body Prj.Attr is (Name => Pkg_Name, Known => True, First_Attribute => Empty_Attr); + + Add_Package_Name (Get_Name_String (Pkg_Name)); end Register_New_Package; procedure Register_New_Package @@ -805,6 +853,8 @@ package body Prj.Attr is (Name => Pkg_Name, Known => True, First_Attribute => First_Attr); + + Add_Package_Name (Get_Name_String (Pkg_Name)); end Register_New_Package; --------------------------- |