summaryrefslogtreecommitdiff
path: root/gcc/ada/makeutl.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 10:45:20 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 10:45:20 +0000
commite50494f3f8e79a68434cd2a37a163fb7bc5baa66 (patch)
tree7026427e1396c48997b6965dbb6a0c92aa528215 /gcc/ada/makeutl.ads
parent8bdf08aec41fc95bf6576d27511df4965ea67e8c (diff)
downloadgcc-e50494f3f8e79a68434cd2a37a163fb7bc5baa66.tar.gz
2011-08-03 Emmanuel Briot <briot@adacore.com>
* make.adb, makeutl.adb, makeutl.ads, clean.adb (Makeutl.Queue): new package. 2011-08-03 Yannick Moy <moy@adacore.com> * cstand.adb (Create_Standard): select Universal_Integer as an ALFA type * sem_ch3.adb (Array_Type_Declaration): detect array types in ALFA * sem_util.adb, sem_util.ads (Has_Static_Array_Bounds): new function to detect that an array has static bounds. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177264 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/makeutl.ads')
-rw-r--r--gcc/ada/makeutl.ads97
1 files changed, 81 insertions, 16 deletions
diff --git a/gcc/ada/makeutl.ads b/gcc/ada/makeutl.ads
index 6e23e567c7e..a59139563f8 100644
--- a/gcc/ada/makeutl.ads
+++ b/gcc/ada/makeutl.ads
@@ -250,21 +250,86 @@ package Makeutl is
end Mains;
- ----------------------
- -- Marking Routines --
- ----------------------
-
- procedure Mark (Source_File : File_Name_Type; Index : Int := 0);
- -- Mark a unit, identified by its source file and, when Index is not 0, the
- -- index of the unit in the source file. Marking is used to signal that the
- -- unit has already been inserted in the Q.
-
- function Is_Marked
- (Source_File : File_Name_Type;
- Index : Int := 0) return Boolean;
- -- Returns True if the unit was previously marked
-
- procedure Delete_All_Marks;
- -- Remove all file/index couples marked
+ -----------
+ -- Queue --
+ -----------
+
+ type Source_Info_Format is (Format_Gprbuild, Format_Gnatmake);
+
+ package Queue is
+ -- The queue of sources to be checked for compilation.
+ -- There can be a single such queue per application.
+
+ type Source_Info (Format : Source_Info_Format := Format_Gprbuild) is
+ record
+ case Format is
+ when Format_Gprbuild =>
+ Id : Source_Id := null;
+
+ when Format_Gnatmake =>
+ File : File_Name_Type := No_File;
+ Unit : Unit_Name_Type := No_Unit_Name;
+ Index : Int := 0;
+ Project : Project_Id := No_Project;
+ end case;
+ end record;
+ -- Information about files stored in the queue. The exact information
+ -- depends on the builder, and in particular whether it only supports
+ -- project-based files (in which case we have a full Source_Id record).
+
+ procedure Initialize
+ (Queue_Per_Obj_Dir : Boolean;
+ Force : Boolean := False);
+ -- Initialize the queue.
+ -- Queue_Per_Obj_Dir matches the --single-compile-per-obj-dir switch:
+ -- when True, there cannot be simultaneous compilations with the object
+ -- files in the same object directory when project files are used.
+ --
+ -- Nothing is done if Force is False and the queue was already
+ -- initialized.
+
+ procedure Remove_Marks;
+ -- Remove all marks set for the files.
+ -- This means that the files will be handed to the compiler if they are
+ -- added to the queue, and is mostly useful when recompiling several
+ -- executables in non-project mode, as the switches may be different
+ -- and -s may be in use.
+
+ function Is_Empty return Boolean;
+ -- Returns True if the queue is empty
+
+ function Is_Virtually_Empty return Boolean;
+ -- Returns True if the queue is empty or if all object directories are
+ -- busy.
+
+ procedure Insert (Source : Source_Info);
+ function Insert (Source : Source_Info) return Boolean;
+ -- Insert source in the queue.
+ -- The second version returns False if the Source was already marked in
+ -- the queue.
+
+ procedure Extract
+ (Found : out Boolean;
+ Source : out Source_Info);
+ -- Get the first source that can be compiled from the queue. If no
+ -- source may be compiled, sets Found to False. In this case, the value
+ -- for Source is undefined.
+
+ function Size return Natural;
+ -- Return the total size of the queue, including the sources already
+ -- extracted.
+
+ function Processed return Natural;
+ -- Return the number of source in the queue that have aready been
+ -- processed.
+
+ procedure Set_Obj_Dir_Busy (Obj_Dir : Path_Name_Type);
+ procedure Set_Obj_Dir_Free (Obj_Dir : Path_Name_Type);
+ -- Mark Obj_Dir as busy or free (see the parameter to Initialize)
+
+ function Element (Rank : Positive) return File_Name_Type;
+ -- Get the file name for element of index Rank in the queue
+
+ end Queue;
end Makeutl;