Commit be6aaf7f by Arnaud Charlet

(Generic_Separately_Compiled): Rename to Generic_May_Lack_ALI...

	(Generic_Separately_Compiled): Rename to Generic_May_Lack_ALI, more
	descriptive of the current use of the predicate, and update
	documentation.

From-SVN: r127469
parent f9622ab1
...@@ -593,42 +593,23 @@ package Lib is ...@@ -593,42 +593,23 @@ package Lib is
-- time stamp are also output. File_Names_Only also restricts the list to -- time stamp are also output. File_Names_Only also restricts the list to
-- exclude any predefined files. -- exclude any predefined files.
function Generic_Separately_Compiled (E : Entity_Id) return Boolean; function Generic_May_Lack_ALI (Sfile : File_Name_Type) return Boolean;
-- This is the old version of tbe documentation of this function: -- Generic units must be separately compiled. Since we always use
--
-- Most generic units must be separately compiled. Since we always use
-- macro substitution for generics, the resulting object file is a dummy -- macro substitution for generics, the resulting object file is a dummy
-- one with no code, but the ali file has the normal form, and we need -- one with no code, but the ALI file has the normal form, and we need
-- this ali file so that the binder can work out a correct order of -- this ALI file so that the binder can work out a correct order of
-- elaboration. However, we do not need to separate compile generics -- elaboration.
-- if the generic files are language defined, since in this case there
-- are no order of elaborration problems, and we can simply incorporate -- However, ancient versions of GNAT used to not generate code or ALI
-- the context clause of the generic unit into the client. There are two -- files for generic units, and this would yield complex order of
-- reasons for making this exception for predefined units. First, clearly -- elaboration issues. These were fixed in GNAT 3.10. The support for not
-- it is more efficient not to introduce extra unnecessary files. Second, -- compiling language-defined library generics was retained nonetheless
-- the old version of GNAT did not compile any generic units. That was -- to facilitate bootstrap. Specifically, it is convenient to have
-- clearly incorrect in some cases of complex order of elaboration and -- the same list of files to be compiled for all stages. So, if the
-- was fixed in version 3.10 of GNAT. However, the transition would have -- bootstrap compiler does not generate code for a given file, then
-- caused bootstrap path problems in the case of generics used in the -- the stage1 compiler (and binder) also must deal with the case of
-- compiler itself. The only such generics are predefined ones. This -- that file not being compiled. The predicate Generic_May_Lack_ALI is
-- function returns True if the given generic unit entity E is for a -- True for those generic units for which missing ALI files are allowed.
-- generic unit that should be separately compiled, and false otherwise.
--
-- Now GNAT can compile any generic unit including predefined ones, but
-- because of the backward compatibility (to keep the ability to use old
-- compiler versions to build GNAT) compiling library generics is an
-- option. That is, now GNAT compiles a library generic as an ordinary
-- unit, but it also can build an exeutable in case if its library contains
-- some (or all) predefined generics non compiled. See 9628-002 for the
-- description of changes to be done to get rid of a special processing of
-- library generic.
--
-- So now this function returns TRUE if a generic MUST be separately
-- compiled with the current approach.
function Generic_Separately_Compiled
(Sfile : File_Name_Type) return Boolean;
-- Same as the previous function, but works directly on a unit file name
private private
pragma Inline (Cunit); pragma Inline (Cunit);
...@@ -756,8 +737,8 @@ private ...@@ -756,8 +737,8 @@ private
-- Type to hold list of indirect references to unit number table -- Type to hold list of indirect references to unit number table
type Load_Stack_Entry is record type Load_Stack_Entry is record
Unit_Number : Unit_Number_Type; Unit_Number : Unit_Number_Type;
From_Limited_With : Boolean; With_Node : Node_Id;
end record; end record;
-- The Load_Stack table contains a list of unit numbers (indices into the -- The Load_Stack table contains a list of unit numbers (indices into the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment