Commit 00838d9a by Arnaud Charlet

[multiple changes]

2009-07-15  Sergey Rybin  <rybin@adacore.com>

	* tree_in.ads, output.adb, tree_io.ads: Get rid of pragmas Warnings
	Off/On for with clause to System.OS_Lib - not needed any more.

2009-07-15  Ed Schonberg  <schonberg@adacore.com>

	* sem_warn.adb (Warn_On_Constant_Condition): if the constant condition
	is a literal of a derived boolean type, it appears as an unchecked
	conversion. Retrieve actual value from expression of conversion.

2009-07-15  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb: Minor reformatting

	* lib-xref.ads, lib-xref.adb, lib.ads, par_sco.ads, par_sco.adb,
	lib-writ.ads, lib-writ.adb: Minor reformatting.
	Fix problem with SCO format in ALI files

From-SVN: r149674
parent fa01135d
2009-07-15 Ed Schonberg <schonberg@adacore.com>
* sem_warn.adb (Warn_On_Constant_Condition): if the constant condition
is a literal of a derived boolean type, it appears as an unchecked
conversion. Retrieve actual value from expression of conversion.
2009-07-15 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb: Minor reformatting
* lib-xref.ads, lib-xref.adb, lib.ads, par_sco.ads, par_sco.adb,
lib-writ.ads, lib-writ.adb: Minor reformatting.
Fix problem with SCO format in ALI files
2009-07-15 Robert Dewar <dewar@adacore.com> 2009-07-15 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, exp_util.adb, tbuild.adb, tbuild.ads, exp_ch4.adb, * exp_ch7.adb, exp_util.adb, tbuild.adb, tbuild.ads, exp_ch4.adb,
...@@ -36,11 +50,6 @@ ...@@ -36,11 +50,6 @@
* gcc-interface/Make-lang.in: Add dependency on par_sco.o for gnat1 * gcc-interface/Make-lang.in: Add dependency on par_sco.o for gnat1
2009-07-15 Sergey Rybin <rybin@adacore.com>
* tree_in.ads, tree_io.ads: Add pragma Warnings Off/On for with clause
to System.OS_Lib to avoid warnings.
2009-07-15 Robert Dewar <dewar@adacore.com> 2009-07-15 Robert Dewar <dewar@adacore.com>
* sinfo.ads, make.adb, par.ads, par.adb, sem_warn.adb: Minor * sinfo.ads, make.adb, par.ads, par.adb, sem_warn.adb: Minor
......
...@@ -632,12 +632,6 @@ package body Lib.Writ is ...@@ -632,12 +632,6 @@ package body Lib.Writ is
end if; end if;
end; end;
end loop; end loop;
-- Output SCO information if present
if Generate_SCO then
SCO_Output (Unit_Num);
end if;
end Write_Unit_Information; end Write_Unit_Information;
---------------------- ----------------------
...@@ -1236,8 +1230,20 @@ package body Lib.Writ is ...@@ -1236,8 +1230,20 @@ package body Lib.Writ is
end loop; end loop;
end; end;
Output_References; -- Output cross-reference information
Write_Info_Terminate; Write_Info_Terminate;
Output_References;
-- Output SCO information if present
if Generate_SCO then
Write_Info_Terminate;
SCO_Output;
end if;
-- Output of ALI file is complete
Close_Output_Library_Info; Close_Output_Library_Info;
end Write_ALI; end Write_ALI;
......
...@@ -31,15 +31,15 @@ package Lib.Writ is ...@@ -31,15 +31,15 @@ package Lib.Writ is
-- Format of Library Information -- -- Format of Library Information --
----------------------------------- -----------------------------------
-- This section describes the format of the library information that is -- This section describes the format of the library information that is
-- associated with object files. The exact method of this association is -- associated with object files. The exact method of this association is
-- potentially implementation dependent and is described and implemented -- potentially implementation dependent and is described and implemented in
-- in package ali. From the point of view of the description here, all we -- package ali. From the point of view of the description here, all we need
-- need to know is that the information is represented as a string of -- to know is that the information is represented as a string of characters
-- characters that is somehow associated with an object file, and can be -- that is somehow associated with an object file, and can be retrieved. If
-- retrieved. If no library information exists for a given object file, -- no library information exists for a given object file, then we take this
-- then we take this as equivalent to the non-existence of the object -- as equivalent to the non-existence of the object file, as if source file
-- file, as if source file has not been previously compiled. -- has not been previously compiled.
-- The library information is written as a series of lines of the form: -- The library information is written as a series of lines of the form:
...@@ -51,49 +51,48 @@ package Lib.Writ is ...@@ -51,49 +51,48 @@ package Lib.Writ is
-- Making Changes to the ALI Format -- -- Making Changes to the ALI Format --
-------------------------------------- --------------------------------------
-- A number of tools use ali.adb to parse ali files. This means -- A number of tools use ali.adb to parse ali files. This means that
-- that changes to this format can cause old versions of these tools -- changes to this format can cause old versions of these tools to be
-- to be incompatible with new versions of the compiler. Any changes -- incompatible with new versions of the compiler. Any changes to ali file
-- to ali file formats must be carefully evaluated to understand any -- formats must be carefully evaluated to understand any such possible
-- such possible conflicts, and in particular, it is very undesirable -- conflicts, and in particular, it is very undesirable to create conflicts
-- to create conflicts between older versions of GPS and newer versions -- between older versions of GPS and newer versions of the compiler.
-- of the compiler.
-- If the following guidelines are respected, downward compatibility -- If the following guidelines are respected, downward compatibility
-- problems (old tools reading new ali files) should be minimized: -- problems (old tools reading new ali files) should be minimized:
-- The basic key character format must be kept -- The basic key character format must be kept
-- The V line must be the first line, this is checked by ali.adb -- The V line must be the first line, this is checked by ali.adb even in
-- even in Ignore_Errors mode, and is used to verify that the file -- Ignore_Errors mode, and is used to verify that the file at hand is
-- at hand is indeed likely intended to be an ali file. -- indeed likely intended to be an ali file.
-- The P line must be present, though may be modified in contents -- The P line must be present, though may be modified in contents
-- according to remaining guidelines. Again, ali.adb assumes the -- according to remaining guidelines. Again, ali.adb assumes the P
-- P line is present even in Ignore_Errors mode. -- line is present even in Ignore_Errors mode.
-- New modifiers can generally be added (in particular adding new -- New modifiers can generally be added (in particular adding new two
-- two letter modifiers to the P or U lines is always safe) -- letter modifiers to the P or U lines is always safe)
-- Adding entirely new lines (with a new key letter) to the ali -- Adding entirely new lines (with a new key letter) to the ali file is
-- file is always safe, at any point (other than before the V -- always safe, at any point (other than before the V line), since such
-- line), since such lines will be ignored. -- lines will be ignored.
-- Following the guidelines in this section should ensure that this -- Following the guidelines in this section should ensure that this problem
-- problem is minimized and that old tools will be able to deal -- is minimized and that old tools will be able to deal successfully with
-- successfully with new ali formats. Note that this does not apply -- new ali formats. Note that this does not apply to the compiler itself,
-- to the compiler itself, which always requires consistency between -- which always requires consistency between the ali files and the binder.
-- the ali files and the binder. That is because one of the main -- That is because one of the main functions of the binder is to ensure
-- functions of the binder is to ensure consistency of the partition, -- consistency of the partition, and this can be compromised if the ali
-- and this can be compromised if the ali files are inconsistent. -- files are inconsistent.
------------------ ------------------
-- Header Lines -- -- Header Lines --
------------------ ------------------
-- The initial header lines in the file give information about the -- The initial header lines in the file give information about the
-- compilation environment, and identify other special information -- compilation environment, and identify other special information such as
-- such as main program parameters. -- main program parameters.
-- ---------------- -- ----------------
-- -- V Version -- -- -- V Version --
...@@ -104,10 +103,10 @@ package Lib.Writ is ...@@ -104,10 +103,10 @@ package Lib.Writ is
-- This line indicates the library output version, as defined in -- This line indicates the library output version, as defined in
-- Gnatvsn. It ensures that separate object modules of a program are -- Gnatvsn. It ensures that separate object modules of a program are
-- consistent. It has to be changed if anything changes which would -- consistent. It has to be changed if anything changes which would
-- affect successful binding of separately compiled modules. -- affect successful binding of separately compiled modules. Examples
-- Examples of such changes are modifications in the format of the -- of such changes are modifications in the format of the library info
-- library info described in this package, or modifications to -- described in this package, or modifications to calling sequences, or
-- calling sequences, or to the way that data is represented. -- to the way that data is represented.
-- Note: the V line absolutely must be the first line, and no change -- Note: the V line absolutely must be the first line, and no change
-- to the ALI format should change this, since even in Ignore_Errors -- to the ALI format should change this, since even in Ignore_Errors
...@@ -119,8 +118,8 @@ package Lib.Writ is ...@@ -119,8 +118,8 @@ package Lib.Writ is
-- M type [priority] [T=time-slice] W=? -- M type [priority] [T=time-slice] W=?
-- This line appears only if the main unit for this file is -- This line appears only if the main unit for this file is suitable
-- suitable for use as a main program. The parameters are: -- for use as a main program. The parameters are:
-- type -- type
...@@ -131,24 +130,24 @@ package Lib.Writ is ...@@ -131,24 +130,24 @@ package Lib.Writ is
-- priority -- priority
-- Present only if there was a valid pragma Priority in the -- Present only if there was a valid pragma Priority in the
-- corresponding unit to set the main task priority. It is -- corresponding unit to set the main task priority. It is an
-- an unsigned decimal integer. -- unsigned decimal integer.
-- T=time-slice -- T=time-slice
-- Present only if there was a valid pragma Time_Slice in the -- Present only if there was a valid pragma Time_Slice in the
-- corresponding unit. It is an unsigned decimal integer in -- corresponding unit. It is an unsigned decimal integer in the
-- the range 0 .. 10**9 giving the time slice value in units -- range 0 .. 10**9 giving the time slice value in units of
-- of milliseconds. The actual significance of this parameter -- milliseconds. The actual significance of this parameter is
-- is target dependent. -- target dependent.
-- W=? -- W=?
-- This parameter indicates the wide character encoding -- This parameter indicates the wide character encoding method used
-- method used when compiling the main program file. The ? -- when compiling the main program file. The ? character is the
-- character is the single character used in the -gnatW? -- single character used in the -gnatW? switch. This is used to
-- switch. This is used to provide the default wide-character -- provide the default wide-character encoding for Wide_Text_IO
-- encoding for Wide_Text_IO files. -- files.
-- ----------------- -- -----------------
-- -- A Argument -- -- -- A Argument --
...@@ -156,9 +155,9 @@ package Lib.Writ is ...@@ -156,9 +155,9 @@ package Lib.Writ is
-- A argument -- A argument
-- One of these lines appears for each of the arguments present -- One of these lines appears for each of the arguments present in the
-- in the call to the gnat1 program. This can be used if it is -- call to the gnat1 program. This can be used if it is necessary to
-- necessary to reconstruct this call (e.g. for fix and continue) -- reconstruct this call (e.g. for fix and continue)
-- ------------------- -- -------------------
-- -- P Parameters -- -- -- P Parameters --
...@@ -166,44 +165,44 @@ package Lib.Writ is ...@@ -166,44 +165,44 @@ package Lib.Writ is
-- P <<parameters>> -- P <<parameters>>
-- Indicates various information that applies to the compilation -- Indicates various information that applies to the compilation of the
-- of the corresponding source file. Parameters is a sequence of -- corresponding source file. Parameters is a sequence of zero or more
-- zero or more two letter codes that indicate configuration -- two letter codes that indicate configuration pragmas and other
-- pragmas and other parameters that apply: -- parameters that apply:
-- --
-- The arguments are as follows: -- The arguments are as follows:
-- --
-- CE Compilation errors. If this is present it means that the -- CE Compilation errors. If this is present it means that the ali
-- ali file resulted from a compilation with the -gnatQ -- file resulted from a compilation with the -gnatQ switch set,
-- switch set, and illegalities were detected. The ali -- and illegalities were detected. The ali file contents may
-- file contents may not be completely reliable, but the -- not be completely reliable, but the format will be correct
-- format will be correct and complete. Note that NO is -- and complete. Note that NO is always present if CE is
-- always present if CE is present. -- present.
-- --
-- DB Detect_Blocking pragma is in effect for all units in -- DB Detect_Blocking pragma is in effect for all units in this
-- this file. -- file.
-- --
-- FD Configuration pragmas apply to all the units in this -- FD Configuration pragmas apply to all the units in this file
-- file specifying a possibly non-standard floating point -- specifying a possibly non-standard floating point format
-- format (VAX float with Long_Float using D_Float) -- (VAX float with Long_Float using D_Float).
-- --
-- FG Configuration pragmas apply to all the units in this -- FG Configuration pragmas apply to all the units in this file
-- file specifying a possibly non-standard floating point -- specifying a possibly non-standard floating point format
-- format (VAX float with Long_Float using G_Float) -- (VAX float with Long_Float using G_Float).
-- --
-- FI Configuration pragmas apply to all the units in this -- FI Configuration pragmas apply to all the units in this file
-- file specifying a possibly non-standard floating point -- specifying a possibly non-standard floating point format
-- format (IEEE Float) -- (IEEE Float).
-- --
-- Lx A valid Locking_Policy pragma applies to all the units -- Lx A valid Locking_Policy pragma applies to all the units in
-- in this file, where x is the first character (upper case) -- this file, where x is the first character (upper case) of
-- of the policy name (e.g. 'C' for Ceiling_Locking) -- the policy name (e.g. 'C' for Ceiling_Locking).
-- --
-- NO No object. This flag indicates that the units in this -- NO No object. This flag indicates that the units in this file
-- file were not compiled to produce an object. This can -- were not compiled to produce an object. This can occur as a
-- occur as a result of the use of -gnatc, or if no object -- result of the use of -gnatc, or if no object can be produced
-- can be produced (e.g. when a package spec is compiled -- (e.g. when a package spec is compiled instead of the body,
-- instead of the body, or a subunit on its own). -- or a subunit on its own).
-- --
-- NR No_Run_Time. Indicates that a pragma No_Run_Time applies -- NR No_Run_Time. Indicates that a pragma No_Run_Time applies
-- to all units in the file. -- to all units in the file.
...@@ -241,9 +240,9 @@ package Lib.Writ is ...@@ -241,9 +240,9 @@ package Lib.Writ is
-- possible cases. These values are checked for consistency by the -- possible cases. These values are checked for consistency by the
-- binder and then copied to the generated binder output file. -- binder and then copied to the generated binder output file.
-- Note: The P line must be present. Even in Ignore_Errors mode, -- Note: The P line must be present. Even in Ignore_Errors mode, Scan_ALI
-- Scan_ALI insists on finding a P line. So if changes are made to -- insists on finding a P line. So if changes are made to the ALI format,
-- the ALI format, they should not include removing the P line! -- they should not include removing the P line!
-- --------------------- -- ---------------------
-- -- R Restrictions -- -- -- R Restrictions --
...@@ -257,61 +256,58 @@ package Lib.Writ is ...@@ -257,61 +256,58 @@ package Lib.Writ is
-- R <<restriction-characters>> <<restriction-param-id-entries>> -- R <<restriction-characters>> <<restriction-param-id-entries>>
-- The first parameter is a string of characters that records -- The first parameter is a string of characters that records
-- information regarding restrictions that do not take parameter -- information regarding restrictions that do not take parameter not
-- not take parameter values. It is a string of characters, one -- take parameter values. It is a string of characters, one character
-- character for each value (in order) in All_Boolean_Restrictions. -- for each value (in order) in All_Boolean_Restrictions. There are
-- There are three possible settings for each restriction: -- three possible settings for each restriction:
-- r Restricted. Unit was compiled under control of a pragma -- r Restricted. Unit was compiled under control of a pragma
-- Restrictions for the corresponding restriction. In -- Restrictions for the corresponding restriction. In this case
-- this case the unit certainly does not violate the -- the unit certainly does not violate the Restriction, since
-- Restriction, since this would have been detected by -- this would have been detected by the compiler.
-- the compiler.
-- n Not used. The unit was not compiled under control of a -- n Not used. The unit was not compiled under control of a pragma
-- pragma Restrictions for the corresponding restriction, -- Restrictions for the corresponding restriction, and does not
-- and does not make any use of the referenced feature. -- make any use of the referenced feature.
-- v Violated. The unit was not compiled under control of a -- v Violated. The unit was not compiled under control of a pragma
-- pragma Restrictions for the corresponding restriction, -- Restrictions for the corresponding restriction, and it does
-- and it does indeed use the referenced feature. -- indeed use the referenced feature.
-- This information is used in the binder to check consistency, -- This information is used in the binder to check consistency, i.e. to
-- i.e. to detect cases where one unit has "r" and another unit -- detect cases where one unit has "r" and another unit has "v", which
-- has "v", which is not permitted, since these restrictions -- is not permitted, since these restrictions are partition-wide.
-- are partition-wide.
-- The second parameter, which immediately follows the first (with -- The second parameter, which immediately follows the first (with no
-- no separating space) gives restriction information for identifiers -- separating space) gives restriction information for identifiers for
-- for which a parameter is given. -- which a parameter is given.
-- The parameter is a string of entries, one for each value in -- The parameter is a string of entries, one for each value in
-- Restrict.All_Parameter_Restrictions. Each entry has two -- Restrict.All_Parameter_Restrictions. Each entry has two components
-- components in sequence, the first indicating whether or not -- in sequence, the first indicating whether or not there is a
-- there is a restriction, and the second indicating whether -- restriction, and the second indicating whether or not the compiler
-- or not the compiler detected violations. In the boolean case -- detected violations. In the boolean case it is not necessary to
-- it is not necessary to separate these, since if a restriction -- separate these, since if a restriction is set, and violated, that is
-- is set, and violated, that is an error. But in the parameter -- an error. But in the parameter case, this is not true. For example,
-- case, this is not true. For example, we can have a unit with -- we can have a unit with a pragma Restrictions (Max_Tasks => 4),
-- a pragma Restrictions (Max_Tasks => 4), where the compiler -- where the compiler can detect that there are exactly three tasks
-- can detect that there are exactly three tasks declared. Both -- declared. Both of these pieces of information must be passed to the
-- of these pieces of information must be passed to the binder. -- binder. The parameter of 4 is important in case the total number of
-- The parameter of 4 is important in case the total number of -- tasks in the partition is greater than 4. The parameter of 3 is
-- tasks in the partition is greater than 4. The parameter of -- important in case some other unit has a restrictions pragma with
-- 3 is important in case some other unit has a restrictions -- Max_Tasks=>2.
-- pragma with Max_Tasks=>2.
-- The component for the presence of restriction has one of two -- The component for the presence of restriction has one of two
-- possible forms: -- possible forms:
-- n No pragma for this restriction is present in the -- n No pragma for this restriction is present in the set of units
-- set of units for this ali file. -- for this ali file.
-- rN At least one pragma for this restriction is present -- rN At least one pragma for this restriction is present in the
-- in the set of units for this ali file. The value N -- set of units for this ali file. The value N is the minimum
-- is the minimum parameter value encountered in any -- parameter value encountered in any such pragma. N is in the
-- such pragma. N is in the range of Integer (a value -- range of Integer (a value larger than N'Last causes the
-- larger than N'Last causes the pragma to be ignored). -- pragma to be ignored).
-- The component for the violation detection has one of three -- The component for the violation detection has one of three
-- possible forms: -- possible forms:
...@@ -319,12 +315,12 @@ package Lib.Writ is ...@@ -319,12 +315,12 @@ package Lib.Writ is
-- n No violations were detected by the compiler -- n No violations were detected by the compiler
-- vN A violation was detected. N is either the maximum or total -- vN A violation was detected. N is either the maximum or total
-- count of violations (depending on the checking type) in -- count of violations (depending on the checking type) in all
-- all the units represented by the ali file). Note that -- the units represented by the ali file). Note that this
-- this setting is only allowed for restrictions that are -- setting is only allowed for restrictions that are in
-- in Checked_[Max|Sum]_Parameter_Restrictions. The value -- Checked_[Max|Sum]_Parameter_Restrictions. The value here is
-- here is known to be exact by the compiler and is in the -- known to be exact by the compiler and is in the range of
-- range of Natural. -- Natural.
-- vN+ A violation was detected. The compiler cannot determine -- vN+ A violation was detected. The compiler cannot determine
-- the exact count of violations, but it is at least N. -- the exact count of violations, but it is at least N.
...@@ -354,18 +350,18 @@ package Lib.Writ is ...@@ -354,18 +350,18 @@ package Lib.Writ is
-- I interrupt-number interrupt-state line-number -- I interrupt-number interrupt-state line-number
-- This line records information from an Interrupt_State pragma. -- This line records information from an Interrupt_State pragma. There
-- There is one line for each separate pragma, and if no such -- is one line for each separate pragma, and if no such pragmas are
-- pragmas are used, then no I lines are present. -- used, then no I lines are present.
-- The interrupt-number is an unsigned positive integer giving -- The interrupt-number is an unsigned positive integer giving the
-- the value of the interrupt as defined in Ada.Interrupts.Names. -- value of the interrupt as defined in Ada.Interrupts.Names.
-- The interrupt-state is one of r/s/u for Runtime/System/User -- The interrupt-state is one of r/s/u for Runtime/System/User
-- The line number is an unsigned decimal integer giving the -- The line number is an unsigned decimal integer giving the line
-- line number of the corresponding Interrupt_State pragma. -- number of the corresponding Interrupt_State pragma. This is used
-- This is used in consistency messages. -- in consistency messages.
-- ------------------------------------- -- -------------------------------------
-- -- S Priority Specific Dispatching -- -- -- S Priority Specific Dispatching --
...@@ -383,23 +379,22 @@ package Lib.Writ is ...@@ -383,23 +379,22 @@ package Lib.Writ is
-- The first_priority and last_priority fields define the range of -- The first_priority and last_priority fields define the range of
-- priorities to which the specified dispatching policy apply. -- priorities to which the specified dispatching policy apply.
-- The line number is an unsigned decimal integer giving the -- The line number is an unsigned decimal integer giving the line
-- line number of the corresponding Priority_Specific_Dispatching -- number of the corresponding Priority_Specific_Dispatching pragma.
-- pragma. This is used in consistency messages. -- This is used in consistency messages.
---------------------------- ----------------------------
-- Compilation Unit Lines -- -- Compilation Unit Lines --
---------------------------- ----------------------------
-- Following these header lines, a set of information lines appears for -- Following these header lines, a set of information lines appears for
-- each compilation unit that appears in the corresponding object file. -- each compilation unit that appears in the corresponding object file. In
-- In particular, when a package body or subprogram body is compiled, -- particular, when a package body or subprogram body is compiled, there
-- there will be two sets of information, one for the spec and one for -- will be two sets of information, one for the spec and one for the body,
-- the body, with the entry for the body appearing first. This is the -- with the entry for the body appearing first. This is the only case in
-- only case in which a single ALI file contains more than one unit (in -- which a single ALI file contains more than one unit (in particular note
-- particular note that subunits do *not* count as compilation units for -- that subunits do *not* count as compilation units for this purpose, and
-- this purpose, and generate no library information, since they are -- generate no library information, since they are inlined).
-- inlined).
-- -------------------- -- --------------------
-- -- U Unit Header -- -- -- U Unit Header --
...@@ -409,15 +404,14 @@ package Lib.Writ is ...@@ -409,15 +404,14 @@ package Lib.Writ is
-- U unit-name source-name version <<attributes>> -- U unit-name source-name version <<attributes>>
-- --
-- This line identifies the unit to which this section of the -- This line identifies the unit to which this section of the library
-- library information file applies. The first three parameters are -- information file applies. The first three parameters are the unit
-- the unit name in internal format, as described in package Uname, -- name in internal format, as described in package Uname, and the name
-- and the name of the source file containing the unit. -- of the source file containing the unit.
-- --
-- Version is the version given as eight hexadecimal characters -- Version is the version given as eight hexadecimal characters with
-- with upper case letters. This value is the exclusive or of the -- upper case letters. This value is the exclusive or of the source
-- source checksums of the unit and all its semantically dependent -- checksums of the unit and all its semantically dependent units.
-- units.
-- --
-- The <<attributes>> are a series of two letter codes indicating -- The <<attributes>> are a series of two letter codes indicating
-- information about the unit: -- information about the unit:
...@@ -430,47 +424,47 @@ package Lib.Writ is ...@@ -430,47 +424,47 @@ package Lib.Writ is
-- not promise, to keep the elaboration of the body close to -- not promise, to keep the elaboration of the body close to
-- the elaboration of the spec. -- the elaboration of the spec.
-- --
-- DE Dynamic Elaboration. This unit was compiled with the -- DE Dynamic Elaboration. This unit was compiled with the dynamic
-- dynamic elaboration model, as set by either the -gnatE -- elaboration model, as set by either the -gnatE switch or
-- switch or pragma Elaboration_Checks (Dynamic). -- pragma Elaboration_Checks (Dynamic).
-- --
-- EB Unit has pragma Elaborate_Body, or is a generic instance -- EB Unit has pragma Elaborate_Body, or is a generic instance that
-- that has a body. Set for instances because RM 12.3(20) -- has a body. Set for instances because RM 12.3(20) requires
-- requires that the body be immediately elaborated after the -- that the body be immediately elaborated after the spec (we
-- spec (we would normally do that anyway, because elaborate -- would normally do that anyway, because elaborate spec and
-- spec and body together whenever possible, and for an instance -- body together whenever possible, and for an instance it is
-- it is always possible; however setting EB ensures that this -- always possible; however setting EB ensures that this is done
-- is done even when using the -p gnatbind switch). -- even when using the -p gnatbind switch).
-- --
-- EE Elaboration entity is present which must be set true when -- EE Elaboration entity is present which must be set true when
-- the unit is elaborated. The name of the elaboration entity -- the unit is elaborated. The name of the elaboration entity is
-- is formed from the unit name in the usual way. If EE is -- formed from the unit name in the usual way. If EE is present,
-- present, then this boolean must be set True as part of the -- then this boolean must be set True as part of the elaboration
-- elaboration processing routine generated by the binder. -- processing routine generated by the binder. Note that EE can
-- Note that EE can be set even if NE is set. This happens -- be set even if NE is set. This happens when the boolean is
-- when the boolean is needed solely for checking for the -- needed solely for checking for the case of access before
-- case of access before elaboration. -- elaboration.
-- --
-- GE Unit is a generic declaration, or corresponding body -- GE Unit is a generic declaration, or corresponding body
-- --
-- IL Unit source uses a style with identifiers in all lower -- IL Unit source uses a style with identifiers in all lower-case
-- IU case (IL) or all upper case (IU). If the standard mixed- -- IU (IL) or all upper case (IU). If the standard mixed-case usage
-- case usage is detected, or the compiler cannot determine -- is detected, or the compiler cannot determine the style, then
-- the style, then no I parameter will appear. -- no I parameter will appear.
-- --
-- IS Initialize_Scalars pragma applies to this unit, or else there -- IS Initialize_Scalars pragma applies to this unit, or else there
-- is at least one use of the Invalid_Value attribute. -- is at least one use of the Invalid_Value attribute.
-- --
-- KM Unit source uses a style with keywords in mixed case -- KM Unit source uses a style with keywords in mixed case (KM)
-- KU (KM) or all upper case (KU). If the standard lower-case -- KU or all upper case (KU). If the standard lower-case usage is
-- usage is detected, or the compiler cannot determine the -- is detected, or the compiler cannot determine the style, then
-- style, then no K parameter will appear. -- no K parameter will appear.
-- --
-- NE Unit has no elaboration routine. All subprogram bodies -- NE Unit has no elaboration routine. All subprogram bodies and
-- and specs are in this category. Package bodies and specs -- specs are in this category. Package bodies and specs may or
-- may or may not have NE set, depending on whether or not -- may not have NE set, depending on whether or not elaboration
-- elaboration code is required. Set if N_Compilation_Unit -- code is required. Set if N_Compilation_Unit node has flag
-- node has flag Has_No_Elaboration_Code set. -- Has_No_Elaboration_Code set.
-- --
-- OL The units in this file are compiled with a local pragma -- OL The units in this file are compiled with a local pragma
-- Optimize_Alignment, so no consistency requirement applies -- Optimize_Alignment, so no consistency requirement applies
...@@ -515,10 +509,10 @@ package Lib.Writ is ...@@ -515,10 +509,10 @@ package Lib.Writ is
-- W unit-name [source-name lib-name] [E] [EA] [ED] [AD] -- W unit-name [source-name lib-name] [E] [EA] [ED] [AD]
-- --
-- One of these lines is present for each unit that is mentioned in -- One of these lines is present for each unit that is mentioned in an
-- an explicit with clause by the current unit. The first parameter is -- explicit with clause by the current unit. The first parameter is the
-- the unit name in internal format. The second parameter is the file -- unit name in internal format. The second parameter is the file name
-- name of the file that must be compiled to compile this unit. It is -- of the file that must be compiled to compile this unit. It is
-- usually the file for the body, except for packages which have no -- usually the file for the body, except for packages which have no
-- body. For units that need a body, if the source file for the body -- body. For units that need a body, if the source file for the body
-- cannot be found, the file name of the spec is used instead. The -- cannot be found, the file name of the spec is used instead. The
...@@ -530,21 +524,20 @@ package Lib.Writ is ...@@ -530,21 +524,20 @@ package Lib.Writ is
-- --
-- EA pragma Elaborate_All applies to this unit -- EA pragma Elaborate_All applies to this unit
-- --
-- ED Elaborate_Desirable set for this unit, which means -- ED Elaborate_Desirable set for this unit, which means that there
-- that there is no Elaborate, but the analysis suggests -- is no Elaborate, but the analysis suggests that Program_Error
-- that Program_Error may be raised if the Elaborate -- may be raised if the Elaborate conditions cannot be satisfied.
-- conditions cannot be satisfied. The binder will attempt -- The binder will attempt to treat ED as E if it can.
-- to treat ED as E if it can.
-- --
-- AD Elaborate_All_Desirable set for this unit, which means -- AD Elaborate_All_Desirable set for this unit, which means that
-- that there is no Elaborate_All, but the analysis suggests -- there is no Elaborate_All, but the analysis suggests that
-- that Program_Error may be raised if the Elaborate_All -- Program_Error may be raised if the Elaborate_All conditions
-- conditions cannot be satisfied. The binder will attempt -- cannot be satisfied. The binder will attempt to treat AD as
-- to treat AD as EA if it can. -- EA if it can.
-- --
-- The parameter source-name and lib-name are omitted for the case -- The parameter source-name and lib-name are omitted for the case of a
-- of a generic unit compiled with earlier versions of GNAT which -- generic unit compiled with earlier versions of GNAT which did not
-- did not generate object or ali files for generics. -- generate object or ali files for generics.
-- In fact W lines include implicit withs ??? -- In fact W lines include implicit withs ???
...@@ -552,11 +545,10 @@ package Lib.Writ is ...@@ -552,11 +545,10 @@ package Lib.Writ is
-- -- L Linker_Options -- -- -- L Linker_Options --
-- ----------------------- -- -----------------------
-- Following the W lines (if any, or the U line if not), are an -- Following the W lines (if any, or the U line if not), are an optional
-- optional series of lines that indicates the usage of the pragma -- series of lines that indicates the usage of the pragma Linker_Options in
-- Linker_Options in the associated unit. For each appearance of a -- the associated unit. For each appearance of a pragma Linker_Options (or
-- pragma Linker_Options (or Link_With) in the unit, a line is -- Link_With) in the unit, a line is present with the form:
-- present with the form:
-- L "string" -- L "string"
...@@ -570,50 +562,39 @@ package Lib.Writ is ...@@ -570,50 +562,39 @@ package Lib.Writ is
-- to separate multiple arguments of a single -- to separate multiple arguments of a single
-- Linker_Options pragma. -- Linker_Options pragma.
-- For further details, see Stringt.Write_String_Table_Entry. Note -- For further details, see Stringt.Write_String_Table_Entry. Note that
-- that wide characters in the form {hhhh} cannot be produced, since -- wide characters in the form {hhhh} cannot be produced, since pragma
-- pragma Linker_Option accepts only String, not Wide_String. -- Linker_Option accepts only String, not Wide_String.
-- The L lines are required to appear in the same order as the -- The L lines are required to appear in the same order as the
-- corresponding Linker_Options (or Link_With) pragmas appear in -- corresponding Linker_Options (or Link_With) pragmas appear in the
-- the source file, so that this order is preserved by the binder -- source file, so that this order is preserved by the binder in
-- in constructing the set of linker arguments. -- constructing the set of linker arguments.
-- ------------------------------------
-- -- C Source Coverage Obligations --
-- -------------------------------------
-- Following the L lines (if any) are the SCO (Source Coverage Obligation)
-- lines if they are being generated. For the full format of these lines,
-- see the spec of Par_SCO.
--------------------- ---------------------
-- Reference Lines -- -- Reference Lines --
--------------------- ---------------------
-- The reference lines contain information about references from -- The reference lines contain information about references from any of the
-- any of the units in the compilation (including, body version -- units in the compilation (including, body version and version
-- and version attributes, linker options pragmas and source -- attributes, linker options pragmas and source dependencies.
-- dependencies.
-- ------------------------------------ -- ------------------------------------
-- -- E External Version References -- -- -- E External Version References --
-- ------------------------------------ -- ------------------------------------
-- One of these lines is present for each use of 'Body_Version or -- One of these lines is present for each use of 'Body_Version or 'Version
-- 'Version in any of the units of the compilation. These are used -- in any of the units of the compilation. These are used by the linker to
-- by the linker to determine which version symbols must be output. -- determine which version symbols must be output. The format is simply:
-- The format is simply:
-- E name -- E name
-- where name is the external name, i.e. the unit name with either -- where name is the external name, i.e. the unit name with either a S or a
-- a S or a B for spec or body version referenced (Body_Version -- B for spec or body version referenced (Body_Version always references
-- always references the body, Version references the Spec, except -- the body, Version references the Spec, except in the case of a reference
-- in the case of a reference to a subprogram with no separate spec). -- to a subprogram with no separate spec). Upper half and wide character
-- Upper half and wide character codes are encoded using the same -- codes are encoded using the same method as in Namet (Uhh for upper half,
-- method as in Namet (Uhh for upper half, Whhhh for wide character, -- Whhhh for wide character, where hh are hex digits).
-- where hh are hex digits).
-- --------------------- -- ---------------------
-- -- D Dependencies -- -- -- D Dependencies --
...@@ -625,55 +606,60 @@ package Lib.Writ is ...@@ -625,55 +606,60 @@ package Lib.Writ is
-- D source-name time-stamp checksum [subunit-name] line:file-name -- D source-name time-stamp checksum [subunit-name] line:file-name
-- The time-stamp field contains the time stamp of the -- The time-stamp field contains the time stamp of the corresponding
-- corresponding source file. See types.ads for details on -- source file. See types.ads for details on time stamp representation.
-- time stamp representation.
-- The checksum is an 8-hex digit representation of the source -- The checksum is an 8-hex digit representation of the source file
-- file checksum, with letters given in lower case. -- checksum, with letters given in lower case.
-- The subunit name is present only if the dependency line is for -- The subunit name is present only if the dependency line is for a
-- a subunit. It contains the fully qualified name of the subunit -- subunit. It contains the fully qualified name of the subunit in all
-- in all lower case letters. -- lower case letters.
-- The line:file-name entry is present only if a Source_Reference -- The line:file-name entry is present only if a Source_Reference
-- pragma appeared in the source file identified by source-name. -- pragma appeared in the source file identified by source-name. In
-- In this case, it gives the information from this pragma. Note -- this case, it gives the information from this pragma. Note that this
-- that this allows cross-reference information to be related back -- allows cross-reference information to be related back to the
-- to the original file. Note: the reason the line number comes -- original file. Note: the reason the line number comes first is that
-- first is that a leading digit immediately identifies this as -- a leading digit immediately identifies this as a Source_Reference
-- a Source_Reference entry, rather than a subunit-name. -- entry, rather than a subunit-name.
-- A line number of zero for line: in this entry indicates that -- A line number of zero for line: in this entry indicates that there
-- there is more than one source reference pragma. In this case, -- is more than one source reference pragma. In this case, the line
-- the line numbers in the cross-reference are correct, and refer -- numbers in the cross-reference are correct, and refer to the
-- to the original line number, but there is no information that -- original line number, but there is no information that allows a
-- allows a reader of the ALI file to determine the exact mapping -- reader of the ALI file to determine the exact mapping of physical
-- of physical line numbers back to the original source. -- line numbers back to the original source.
-- Files with a zero checksum and a non-zero time stamp are in general -- Files with a zero checksum and a non-zero time stamp are in general
-- files on which the compilation depends but which are not Ada files -- files on which the compilation depends but which are not Ada files
-- with further dependencies. This includes preprocessor data files -- with further dependencies. This includes preprocessor data files
-- and preprocessor definition files. -- and preprocessor definition files.
-- Note: blank lines are ignored when the library information is -- Note: blank lines are ignored when the library information is read,
-- read, and separate sections of the file are separated by blank -- and separate sections of the file are separated by blank lines to
-- lines to ease readability. Blanks between fields are also -- ease readability. Blanks between fields are also ignored.
-- ignored.
-- For entries corresponding to files that were not present (and -- For entries corresponding to files that were not present (and thus
-- thus resulted in error messages), or for files that are not -- resulted in error messages), or for files that are not part of the
-- part of the dependency set, both the time stamp and checksum -- dependency set, both the time stamp and checksum are set to all zero
-- are set to all zero characters. These dummy entries are ignored -- characters. These dummy entries are ignored by the binder in
-- by the binder in dependency checking, but must be present for -- dependency checking, but must be present for proper interpretation
-- proper interpretation of the cross-reference data. -- of the cross-reference data.
-------------------------- --------------------------
-- Cross-Reference Data -- -- Cross-Reference Data --
-------------------------- --------------------------
-- The cross-reference data follows the dependency lines. See -- The cross-reference data follows the dependency lines. See the spec of
-- the spec of Lib.Xref for details on the format of this data. -- Lib.Xref for details on the format of this data.
---------------------------------
-- Source Coverage Obligations --
---------------------------------
-- The Source Coverage Obligation (SCO) information follows the cross-
-- reference data. See the spec of Par_SCO for full details of the format.
---------------------- ----------------------
-- Global_Variables -- -- Global_Variables --
...@@ -706,9 +692,9 @@ package Lib.Writ is ...@@ -706,9 +692,9 @@ package Lib.Writ is
-- The table structure defined here stores one entry for each -- The table structure defined here stores one entry for each
-- Priority_Specific_Dispatching pragma encountered either in the main -- Priority_Specific_Dispatching pragma encountered either in the main
-- source or in an ancillary with'ed source. Since -- source or in an ancillary with'ed source. Since have to be consistent
-- have to be consistent across all units in a partition, we may -- across all units in a partition, we may as well detect inconsistencies
-- as well detect inconsistencies at compile time when we can. -- at compile time when we can.
type Specific_Dispatching_Entry is record type Specific_Dispatching_Entry is record
Dispatching_Policy : Character; Dispatching_Policy : Character;
...@@ -739,9 +725,9 @@ package Lib.Writ is ...@@ -739,9 +725,9 @@ package Lib.Writ is
----------------- -----------------
procedure Ensure_System_Dependency; procedure Ensure_System_Dependency;
-- This procedure ensures that a dependency is created on system.ads. -- This procedure ensures that a dependency is created on system.ads. Even
-- Even if there is no semantic dependency, Targparm has read the -- if there is no semantic dependency, Targparm has read the file to
-- file to acquire target parameters, so we need a source dependency. -- acquire target parameters, so we need a source dependency.
procedure Write_ALI (Object : Boolean); procedure Write_ALI (Object : Boolean);
-- This procedure writes the library information for the current main unit -- This procedure writes the library information for the current main unit
...@@ -755,7 +741,7 @@ package Lib.Writ is ...@@ -755,7 +741,7 @@ package Lib.Writ is
-- the A lines in this file. -- the A lines in this file.
procedure Add_Preprocessing_Dependency (S : Source_File_Index); procedure Add_Preprocessing_Dependency (S : Source_File_Index);
-- Indicate that there is a dependency to be added on a preprocessing -- Indicate that there is a dependency to be added on a preprocessing data
-- data file or on a preprocessing definition file. -- file or on a preprocessing definition file.
end Lib.Writ; end Lib.Writ;
...@@ -2137,6 +2137,7 @@ package body Lib.Xref is ...@@ -2137,6 +2137,7 @@ package body Lib.Xref is
begin begin
Write_Info_Char ('['); Write_Info_Char ('[');
if Curru /= Gen_U then if Curru /= Gen_U then
Write_Info_Nat (Dependency_Num (Gen_U)); Write_Info_Nat (Dependency_Num (Gen_U));
Write_Info_Char ('|'); Write_Info_Char ('|');
...@@ -2230,7 +2231,7 @@ package body Lib.Xref is ...@@ -2230,7 +2231,7 @@ package body Lib.Xref is
Output_Import_Export_Info (XE.Ent); Output_Import_Export_Info (XE.Ent);
end if; end if;
Write_Info_Nat (Int (Get_Column_Number (XE.Loc))); Write_Info_Nat (Int (Get_Column_Number (XE.Loc)));
Output_Instantiation_Refs (Sloc (XE.Ent)); Output_Instantiation_Refs (Sloc (XE.Ent));
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -42,7 +42,7 @@ package Lib.Xref is ...@@ -42,7 +42,7 @@ package Lib.Xref is
-- X dependency-number filename -- X dependency-number filename
-- This header precedes xref information (entities/references from -- This header precedes xref information (entities/references from
-- the unit, identified by dependency number and file name. The -- the unit), identified by dependency number and file name. The
-- dependency number is the index into the generated D lines and -- dependency number is the index into the generated D lines and
-- is ones origin (i.e. 2 = reference to second generated D line). -- is ones origin (i.e. 2 = reference to second generated D line).
......
...@@ -295,7 +295,7 @@ package Lib is ...@@ -295,7 +295,7 @@ package Lib is
-- order. The number is ones origin, so a value of 2 refers to the -- order. The number is ones origin, so a value of 2 refers to the
-- second generated D line. The Dependency_Number values are set -- second generated D line. The Dependency_Number values are set
-- as the D lines are generated, and are used to generate proper -- as the D lines are generated, and are used to generate proper
-- unit references in the generated xref information. -- unit references in the generated xref information and SCO output.
-- Dynamic_Elab -- Dynamic_Elab
-- A flag indicating if this unit was compiled with dynamic elaboration -- A flag indicating if this unit was compiled with dynamic elaboration
......
...@@ -29,13 +29,7 @@ ...@@ -29,13 +29,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Note: the pragma Warnings (Off) here is because ASIS compiles this unit
-- without -gnatg, and System.OS_Lib is an implementation unit. This is a
-- temporary kludge which will be better resolved later on ???
pragma Warnings (Off);
with System.OS_Lib; use System.OS_Lib; with System.OS_Lib; use System.OS_Lib;
pragma Warnings (On);
package body Output is package body Output is
......
...@@ -536,9 +536,10 @@ package body Par_SCO is ...@@ -536,9 +536,10 @@ package body Par_SCO is
-- SCO_Output -- -- SCO_Output --
---------------- ----------------
procedure SCO_Output (U : Unit_Number_Type) is procedure SCO_Output is
Start : Nat; Start : Nat;
Stop : Nat; Stop : Nat;
U : Unit_Number_Type;
procedure Output_Range (From : Source_Ptr; To : Source_Ptr); procedure Output_Range (From : Source_Ptr; To : Source_Ptr);
-- Outputs Sloc range in line:col-line:col format (for now we do not -- Outputs Sloc range in line:col-line:col format (for now we do not
...@@ -566,10 +567,19 @@ package body Par_SCO is ...@@ -566,10 +567,19 @@ package body Par_SCO is
dsco; dsco;
end if; end if;
-- Find entry in unit table and set Start/Stop bounds in SCO table -- Loop through entries in the unit table
for J in SCO_Unit_Table.First .. SCO_Unit_Table.Last loop for J in SCO_Unit_Table.First .. SCO_Unit_Table.Last loop
if U = SCO_Unit_Table.Table (J).Unit then U := SCO_Unit_Table.Table (J).Unit;
if In_Extended_Main_Source_Unit (Cunit_Entity (U)) then
Write_Info_Initiate ('C');
Write_Info_Char (' ');
Write_Info_Nat (Dependency_Num (U));
Write_Info_Char (' ');
Write_Info_Name (Reference_Name (Source_Index (U)));
Write_Info_Terminate;
Start := SCO_Unit_Table.Table (J).Index; Start := SCO_Unit_Table.Table (J).Index;
if J = SCO_Unit_Table.Last then if J = SCO_Unit_Table.Last then
...@@ -578,76 +588,70 @@ package body Par_SCO is ...@@ -578,76 +588,70 @@ package body Par_SCO is
Stop := SCO_Unit_Table.Table (J + 1).Index - 1; Stop := SCO_Unit_Table.Table (J + 1).Index - 1;
end if; end if;
exit; -- Loop through relevant entries in SCO table, outputting C lines
end if;
-- Seems like we should find the unit, but for now ignore ???
return;
end loop;
-- Loop through relevant entries in SCO table, outputting C lines while Start <= Stop loop
declare
while Start <= Stop loop T : SCO_Table_Entry renames SCO_Table.Table (Start);
declare
T : SCO_Table_Entry renames SCO_Table.Table (Start);
begin begin
Write_Info_Initiate ('C'); Write_Info_Initiate ('C');
Write_Info_Char (T.C1); Write_Info_Char (T.C1);
case T.C1 is case T.C1 is
-- Statements, entry, exit -- Statements, entry, exit
when 'S' | 'Y' | 'T' => when 'S' | 'Y' | 'T' =>
Write_Info_Char (' '); Write_Info_Char (' ');
Output_Range (T.From, T.To); Output_Range (T.From, T.To);
-- Decision -- Decision
when 'I' | 'E' | 'W' | 'X' => when 'I' | 'E' | 'W' | 'X' =>
if T.C2 = ' ' then if T.C2 = ' ' then
Start := Start + 1; Start := Start + 1;
end if; end if;
-- Loop through table entries for this decision -- Loop through table entries for this decision
loop loop
declare declare
T : SCO_Table_Entry renames SCO_Table.Table (Start); T : SCO_Table_Entry renames SCO_Table.Table (Start);
begin begin
Write_Info_Char (' '); Write_Info_Char (' ');
if T.C1 = '!' or else if T.C1 = '!' or else
T.C1 = '^' or else T.C1 = '^' or else
T.C1 = '&' or else T.C1 = '&' or else
T.C1 = '|' T.C1 = '|'
then then
Write_Info_Char (T.C1); Write_Info_Char (T.C1);
else else
Write_Info_Char (T.C2); Write_Info_Char (T.C2);
Output_Range (T.From, T.To); Output_Range (T.From, T.To);
end if; end if;
exit when T.Last; exit when T.Last;
Start := Start + 1; Start := Start + 1;
end; end;
end loop; end loop;
when others => when others =>
raise Program_Error; raise Program_Error;
end case; end case;
Write_Info_Terminate; Write_Info_Terminate;
end; end;
exit when Start = Stop; exit when Start = Stop;
Start := Start + 1; Start := Start + 1;
pragma Assert (Start <= Stop); pragma Assert (Start <= Stop);
end loop;
end if;
end loop; end loop;
end SCO_Output; end SCO_Output;
...@@ -673,8 +677,9 @@ package body Par_SCO is ...@@ -673,8 +677,9 @@ package body Par_SCO is
elsif Nkind (Lu) = N_Package_Body then elsif Nkind (Lu) = N_Package_Body then
Traverse_Package_Body (Lu); Traverse_Package_Body (Lu);
-- Ignore subprogram specifications -- Ignore subprogram specifications, since nothing to cover.
-- Also for now, ignore generic declarations and instantiations -- Also ignore instantiations, since again, nothing to cover.
-- Also for now, ignore generic declarations ???
else else
null; null;
......
...@@ -44,7 +44,29 @@ package Par_SCO is ...@@ -44,7 +44,29 @@ package Par_SCO is
-- to indicate the first and last Sloc of some construct in the tree and -- to indicate the first and last Sloc of some construct in the tree and
-- they have the form: -- they have the form:
-- line:col-line:col ??? do we need generic instantiation stuff ??? -- line:col-line:col
-- Note that SCO's are generated only for generic templates, not for
-- generic instances (since only the first are part of the source). So
-- we don't need generic instantiation stuff in these line:col items.
-- SCO File headers
-- The SCO information follows the cross-reference information, so it
-- need not be read by tools like gnatbind, gnatmake etc. The SCO output
-- is divided into sections, one section for each unit for which SCO's
-- are generated. A SCO section has a header of the form:
-- C dependency-number filename
-- This header precedes SCO information for the unit identified by
-- dependency number and file name. The dependency number is the
-- index into the generated D lines and is ones origin (i.e. 2 =
-- reference to second generated D line).
-- Note that the filename here will reflect the original name if
-- a Source_Reference pragma was encountered (since all line number
-- references will be with respect to the original file).
-- Statements -- Statements
...@@ -193,8 +215,9 @@ package Par_SCO is ...@@ -193,8 +215,9 @@ package Par_SCO is
-- (Typ = 'f') by the compiler. The condition is identified by the -- (Typ = 'f') by the compiler. The condition is identified by the
-- First_Sloc value in the original tree. -- First_Sloc value in the original tree.
procedure SCO_Output (U : Unit_Number_Type); procedure SCO_Output;
-- Outputs SCO lines for unit U in the ALI file, as recorded by a previous -- Outputs SCO lines for all units, with appropriate section headers, for
-- call to SCO_Record, possibly modified by calls to Set_SCO_Condition. -- unit U in the ALI file, as recorded by previous calls to SCO_Record,
-- possibly modified by calls to Set_SCO_Condition.
end Par_SCO; end Par_SCO;
...@@ -13295,9 +13295,9 @@ package body Sem_Ch3 is ...@@ -13295,9 +13295,9 @@ package body Sem_Ch3 is
Ev := Uint_0; Ev := Uint_0;
-- Loop through literals of enumeration type setting pos and rep values -- Loop through literals of enumeration type setting pos and rep values
-- except that if the Ekind is already set, then it means that the -- except that if the Ekind is already set, then it means the literal
-- literal was already constructed (case of a derived type declaration -- was already constructed (case of a derived type declaration and we
-- and we should not disturb the Pos and Rep values. -- should not disturb the Pos and Rep values.
while Present (L) loop while Present (L) loop
if Ekind (L) /= E_Enumeration_Literal then if Ekind (L) /= E_Enumeration_Literal then
......
...@@ -3360,7 +3360,10 @@ package body Sem_Warn is ...@@ -3360,7 +3360,10 @@ package body Sem_Warn is
begin begin
-- Adjust SCO condition if from source -- Adjust SCO condition if from source
if Comes_From_Source (Orig) then if Generate_SCO
and then Comes_From_Source (Orig)
and then Is_Entity_Name (C)
then
declare declare
Start : Source_Ptr; Start : Source_Ptr;
Dummy : Source_Ptr; Dummy : Source_Ptr;
...@@ -3369,6 +3372,7 @@ package body Sem_Warn is ...@@ -3369,6 +3372,7 @@ package body Sem_Warn is
begin begin
Sloc_Range (Orig, Start, Dummy); Sloc_Range (Orig, Start, Dummy);
Atrue := Entity (C) = Standard_True; Atrue := Entity (C) = Standard_True;
if Present (Parent (C)) if Present (Parent (C))
......
...@@ -34,13 +34,7 @@ ...@@ -34,13 +34,7 @@
-- tools that need to read the tree to the tree reading routines, and is -- tools that need to read the tree to the tree reading routines, and is
-- thus bound as part of such tools. -- thus bound as part of such tools.
-- Note: the pragma Warnings (Off) here is because ASIS compiles this unit
-- without -gnatg, and System.OS_Lib is an implementation unit. This is a
-- temporary kludge which will be better resolved later on ???
pragma Warnings (Off);
with System.OS_Lib; use System.OS_Lib; with System.OS_Lib; use System.OS_Lib;
pragma Warnings (On);
procedure Tree_In (Desc : File_Descriptor); procedure Tree_In (Desc : File_Descriptor);
-- Desc is the file descriptor for the file containing the tree, as written -- Desc is the file descriptor for the file containing the tree, as written
......
...@@ -37,14 +37,7 @@ ...@@ -37,14 +37,7 @@
with Types; use Types; with Types; use Types;
with System; use System; with System; use System;
-- Note: the pragma Warnings (Off) here is because ASIS compiles this unit
-- without -gnatg, and System.OS_Lib is an implementation unit. This is a
-- temporary kludge which will be better resolved later on ???
pragma Warnings (Off);
with System.OS_Lib; use System.OS_Lib; with System.OS_Lib; use System.OS_Lib;
pragma Warnings (On);
package Tree_IO is package Tree_IO is
......
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