Commit 05a84157 by Justin Squirek Committed by Pierre-Marie de Rodat

[Ada] Regression in partial compilation of RCI units

This patch fixes an issue whereby the compilation of partial sources
(packages without bodies that require them) would not occur when said
sources were remote call interfaces. This is required because such
interfaces may have bodies that only exist on the server side or vice
versa

2018-09-26  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
	documentation and an extra conditional check for RCI units so
	that generated ali files will list the spec only instead of a
	body when a body is not found.

From-SVN: r264608
parent 738b83cd
2018-09-26 Justin Squirek <squirek@adacore.com>
* lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
documentation and an extra conditional check for RCI units so
that generated ali files will list the spec only instead of a
body when a body is not found.
2018-09-26 Eric Botcazou <ebotcazou@adacore.com> 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (error_gnat_node): Delete. * gcc-interface/gigi.h (error_gnat_node): Delete.
......
...@@ -960,9 +960,14 @@ package body Lib.Writ is ...@@ -960,9 +960,14 @@ package body Lib.Writ is
-- In GNATprove mode we must write the spec of a unit which -- In GNATprove mode we must write the spec of a unit which
-- requires a body if that body is not found. This will -- requires a body if that body is not found. This will
-- allow partial analysis on incomplete sources. -- allow partial analysis on incomplete sources. Also, in
-- the case of a unit that is a remote call interface, the
if GNATprove_Mode then -- bodies of packages may not exist but still may form a
-- valid program - so we handle that here as well.
if GNATprove_Mode
or else Is_Remote_Call_Interface (Cunit_Entity (Unum))
then
Body_Fname := Body_Fname :=
Get_File_Name Get_File_Name
(Uname => Get_Body_Name (Uname), (Uname => Get_Body_Name (Uname),
......
...@@ -624,18 +624,19 @@ package Lib.Writ is ...@@ -624,18 +624,19 @@ package Lib.Writ is
-- Z unit-name [source-name lib-name] [E] [EA] [ED] [AD] -- Z unit-name [source-name lib-name] [E] [EA] [ED] [AD]
-- One W line is present for each unit that is mentioned in an explicit -- One W line is present for each unit that is mentioned in an explicit
-- non-limited with clause by the current unit. One Y line is present -- nonlimited with clause by the current unit. One Y line is present
-- for each unit that is mentioned in an explicit limited with clause -- for each unit that is mentioned in an explicit limited with clause
-- by the current unit. One Z line is present for each unit that is -- by the current unit. One Z line is present for each unit that is
-- only implicitly withed by the current unit. The first parameter is -- only implicitly withed by the current unit. The first parameter is
-- the unit name in internal format. The second parameter is the file -- the unit name in internal format. The second parameter is the file
-- name of the body unit on which the current compliation depends - -- name of the body unit on which the current compilation unit depends,
-- except when in GNATprove mode. In GNATprove mode, when packages -- except when in GNATprove mode or when the unit is a remote call
-- which require a body have no associated source file, the file name -- interface. In these cases, when packages that require a body have
-- of the spec is used instead to allow partial analysis of incomplete -- no associated source file, the file name of the spec is used instead
-- sources. The third parameter is the file name of the library -- to allow partial analysis of incomplete sources. The third parameter
-- information file that contains the results of compiling this unit. -- is the file name of the library information file that contains the
-- The optional modifiers are used as follows: -- results of compiling this unit. The optional modifiers are used as
-- follows:
-- E pragma Elaborate applies to this unit -- E pragma Elaborate applies to this unit
......
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