From: Justin Squirek Date: Wed, 26 Sep 2018 09:16:59 +0000 (+0000) Subject: [Ada] Regression in partial compilation of RCI units X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=05a84157e98dfb25500705c0bc2570139a01075f;p=gcc.git [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 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d6d46eed0b0..e139e2d2c5d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Justin Squirek + + * 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 * gcc-interface/gigi.h (error_gnat_node): Delete. diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index a4f952655f0..f035b45e913 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -960,9 +960,14 @@ package body Lib.Writ is -- In GNATprove mode we must write the spec of a unit which -- requires a body if that body is not found. This will - -- allow partial analysis on incomplete sources. - - if GNATprove_Mode then + -- allow partial analysis on incomplete sources. Also, in + -- the case of a unit that is a remote call interface, the + -- 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 := Get_File_Name (Uname => Get_Body_Name (Uname), diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads index df391a8cc99..9c7c270d109 100644 --- a/gcc/ada/lib-writ.ads +++ b/gcc/ada/lib-writ.ads @@ -624,18 +624,19 @@ package Lib.Writ is -- 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 - -- 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 -- 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 -- the unit name in internal format. The second parameter is the file - -- name of the body unit on which the current compliation depends - - -- except when in GNATprove mode. In GNATprove mode, when packages - -- which require a body have no associated source file, the file name - -- of the spec is used instead to allow partial analysis of incomplete - -- sources. The third parameter is the file name of the library - -- information file that contains the results of compiling this unit. - -- The optional modifiers are used as follows: + -- name of the body unit on which the current compilation unit depends, + -- except when in GNATprove mode or when the unit is a remote call + -- interface. In these cases, when packages that require a body have + -- no associated source file, the file name of the spec is used instead + -- to allow partial analysis of incomplete sources. The third parameter + -- is the file name of the library information file that contains the + -- results of compiling this unit. The optional modifiers are used as + -- follows: -- E pragma Elaborate applies to this unit