From 93ed8a01c6ee6b8c907ff5d055033b34db8a2eef Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Fri, 17 Sep 2004 13:46:12 +0000 Subject: [PATCH] prj-attr-pm.ads, [...]: New files, to split some private capabilities of the general project manager. 2004-09-17 Vincent Celier * prj-attr-pm.ads, prj-attr-pm.adb: New files, to split some private capabilities of the general project manager. From-SVN: r87644 --- gcc/ada/ChangeLog | 5 +++ gcc/ada/prj-attr-pm.adb | 68 +++++++++++++++++++++++++++++++++++++++++ gcc/ada/prj-attr-pm.ads | 45 +++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 gcc/ada/prj-attr-pm.adb create mode 100644 gcc/ada/prj-attr-pm.ads diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c824ae6d9ffd..babbc34f0ddd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2004-09-17 Vincent Celier + + * prj-attr-pm.ads, prj-attr-pm.adb: New files, to split some private + capabilities of the general project manager. + 2004-09-09 Vincent Celier * a-direct.ads: Add pragma Ada_05 diff --git a/gcc/ada/prj-attr-pm.adb b/gcc/ada/prj-attr-pm.adb new file mode 100644 index 000000000000..13ec76fbba82 --- /dev/null +++ b/gcc/ada/prj-attr-pm.adb @@ -0,0 +1,68 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- P R J . A T T R . P M -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2004 Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package body Prj.Attr.PM is + + ------------------- + -- Add_Attribute -- + ------------------- + + procedure Add_Attribute + (To_Package : Package_Node_Id; + Attribute_Name : Name_Id; + Attribute_Node : out Attribute_Node_Id) + is + begin + -- Only add the attribute if the package is already defined + + if To_Package /= Empty_Package then + Attrs.Increment_Last; + Attrs.Table (Attrs.Last) := + (Name => Attribute_Name, + Var_Kind => Undefined, + Optional_Index => False, + Attr_Kind => Unknown, + Next => + Package_Attributes.Table (To_Package.Value).First_Attribute); + Package_Attributes.Table (To_Package.Value).First_Attribute := + Attrs.Last; + Attribute_Node := (Value => Attrs.Last); + end if; + end Add_Attribute; + + ------------------------- + -- Add_Unknown_Package -- + ------------------------- + + procedure Add_Unknown_Package (Name : Name_Id; Id : out Package_Node_Id) is + begin + Package_Attributes.Increment_Last; + Id := (Value => Package_Attributes.Last); + Package_Attributes.Table (Id.Value) := + (Name => Name, Known => False, First_Attribute => Empty_Attr); + end Add_Unknown_Package; + +end Prj.Attr.PM; diff --git a/gcc/ada/prj-attr-pm.ads b/gcc/ada/prj-attr-pm.ads new file mode 100644 index 000000000000..423b60fc759a --- /dev/null +++ b/gcc/ada/prj-attr-pm.ads @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- P R J . A T T R . P M -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2004 Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +with Types; use Types; + +package Prj.Attr.PM is + -- The following procedures are not secure and should only be used by the + -- Project Manager, that is the packages of the Prj or MLib hierarchies. + + procedure Add_Unknown_Package (Name : Name_Id; Id : out Package_Node_Id); + -- Add a new unknown package. The Name cannot be the name of a predefined + -- or already registered package, but this is not checked. + + procedure Add_Attribute + (To_Package : Package_Node_Id; + Attribute_Name : Name_Id; + Attribute_Node : out Attribute_Node_Id); + -- Add an attribute to the list for package To_Package. Attribute_Name + -- cannot be the name of an existing attribute of the package, but this is + -- not checked. Does nothing if To_Package is Empty_Package. + +end Prj.Attr.PM; -- 2.43.5