+2009-11-30 Robert Dewar <dewar@adacore.com>
+
+ * s-stchop-vxworks.adb: Add comment.
+
+2009-11-30 Emmanuel Briot <briot@adacore.com>
+
+ * make.adb, prj.adb, prj.ads (Compute_All_Imported_Projects): Now acts
+ on the whole tree, to better share code with gprbuild.
+ (Length): New subprogram, to share code in gprbuild.
+ (Project_Data): Remove fields that are only needed when compiling a
+ project in gprbuild (where we use local variables instead)
+ * osint.adb, osint.ads: Added minor comment on memory management
+
2009-11-30 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: Update gnatcheck doc.
-- We add the source directories and the object directories to the
-- search paths.
+ -- ??? Why do we need these search directories, we already know the
+ -- locations from parsing the project, except for the runtime which
+ -- has its own directories anyway
Add_Source_Directories (Main_Project, Project_Tree);
Add_Object_Directories (Main_Project);
Recursive_Compute_Depth (Main_Project);
-
- -- For each project compute the list of the projects it imports
- -- directly or indirectly.
-
- declare
- Proj : Project_List;
- begin
- Proj := Project_Tree.Projects;
- while Proj /= null loop
- Compute_All_Imported_Projects (Proj.Project);
- Proj := Proj.Next;
- end loop;
- end;
+ Compute_All_Imported_Projects (Project_Tree);
else
Path_Len : Integer) return String_Access;
-- Converts a C String to an Ada String. Are we doing this to avoid withing
-- Interfaces.C.Strings ???
+ -- Caller must free result
function Include_Dir_Default_Prefix return String_Access;
-- Same as exported version, except returns a String_Access
-- Convert a canonical syntax directory specification to host syntax.
-- The Prefix_Style flag is currently ignored but should be set to
-- False.
+ -- Caller must free result
function To_Host_File_Spec
(Canonical_File : String) return String_Access;
Libgnarl_Needed => Unknown,
Symbol_Data => No_Symbols,
Interfaces_Defined => False,
- Include_Path => null,
- Include_Data_Set => False,
Source_Dirs => Nil_String,
Source_Dir_Ranks => No_Number_List,
Object_Directory => No_Path_Information,
Languages => No_Language_Index,
Decl => No_Declarations,
Imported_Projects => null,
+ Include_Path_File => No_Path,
All_Imported_Projects => null,
Ada_Include_Path => null,
- Imported_Directories_Switches => null,
Ada_Objects_Path => null,
Objects_Path => null,
- Include_Path_File => No_Path,
Objects_Path_File_With_Libs => No_Path,
Objects_Path_File_Without_Libs => No_Path,
Config_File_Name => No_Path,
begin
if Project /= null then
- Free (Project.Include_Path);
Free (Project.Ada_Include_Path);
Free (Project.Objects_Path);
Free (Project.Ada_Objects_Path);
-- Compute_All_Imported_Projects --
-----------------------------------
- procedure Compute_All_Imported_Projects (Project : Project_Id) is
+ procedure Compute_All_Imported_Projects (Tree : Project_Tree_Ref) is
+ Project : Project_Id;
procedure Recursive_Add (Prj : Project_Id; Dummy : in out Boolean);
-- Recursively add the projects imported by project Project, but not
new For_Every_Project_Imported (Boolean, Recursive_Add);
Dummy : Boolean := False;
+ List : Project_List;
begin
- Free_List (Project.All_Imported_Projects, Free_Project => False);
- For_All_Projects (Project, Dummy);
+ List := Tree.Projects;
+ while List /= null loop
+ Project := List.Project;
+ Free_List (Project.All_Imported_Projects, Free_Project => False);
+ For_All_Projects (Project, Dummy);
+ List := List.Next;
+ end loop;
end Compute_All_Imported_Projects;
-------------------
Require_Obj_Dirs => Require_Obj_Dirs);
end Create_Flags;
+ ------------
+ -- Length --
+ ------------
+
+ function Length
+ (Table : Name_List_Table.Instance; List : Name_List_Index) return Natural
+ is
+ Count : Natural := 0;
+ Tmp : Name_List_Index := List;
+ begin
+ while Tmp /= No_Name_List loop
+ Count := Count + 1;
+ Tmp := Table.Table (Tmp).Next;
+ end loop;
+ return Count;
+ end Length;
+
begin
-- Make sure that the standard config and user project file extensions are
-- compatible with canonical case file naming.
Table_Increment => 100);
-- The table for lists of names
+ function Length
+ (Table : Name_List_Table.Instance; List : Name_List_Index) return Natural;
+ -- Return the number of elements in that list
+
type Number_List_Index is new Nat;
No_Number_List : constant Number_List_Index := 0;
-- If Only_If_Ada is True, then No_Name will be returned when the project
-- doesn't Ada sources.
- procedure Compute_All_Imported_Projects (Project : Project_Id);
- -- Compute, the list of the projects imported directly or indirectly by
- -- project Project. The result is stored in Project.All_Imported_Projects
+ procedure Compute_All_Imported_Projects (Tree : Project_Tree_Ref);
+ -- For all projects in the tree, compute the list of the projects imported
+ -- directly or indirectly by project Project. The result is stored in
+ -- Project.All_Imported_Projects for each project
function Ultimate_Extending_Project_Of
(Proj : Project_Id) return Project_Id;
-- True if attribute Interfaces is declared for the project or any
-- project it extends.
- Include_Path : String_Access := null;
- -- The search source path for the project. Used as the value for an
- -- environment variable, specified by attribute Include_Path
- -- (<language>). The names of the environment variables are in component
- -- Include_Path of the records Language_Config.
-
Include_Path_File : Path_Name_Type := No_Path;
- -- The path name of the of the source search directory file
-
- Include_Data_Set : Boolean := False;
- -- Set True when Imported_Directories_Switches or Include_Path are set
+ -- The path name of the of the source search directory file.
+ -- This is only used by gnatmake
Source_Dirs : String_List_Id := Nil_String;
-- The list of all the source directories
-- Miscellaneous --
-------------------
- Imported_Directories_Switches : Argument_List_Access := null;
- -- List of the source search switches (-I<source dir>) to be used
- -- when compiling.
-
Ada_Objects_Path : String_Access := null;
-- The cached value of ADA_OBJECTS_PATH for this project file. Do not
-- use this field directly outside of the compiler, use
Get_Stack_Info (Stack_Info'Access);
+ -- In s-stchop.adb, we check for overflow in the following operations,
+ -- but we have no such check in this vxworks version. Why not ???
+
if Stack_Grows_Down then
Limit := Stack_Info.Base - Storage_Offset (Stack_Info.Size);
else