]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Regression in partial compilation of RCI units
authorJustin Squirek <squirek@adacore.com>
Wed, 26 Sep 2018 09:16:59 +0000 (09:16 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 26 Sep 2018 09:16:59 +0000 (09:16 +0000)
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

gcc/ada/ChangeLog
gcc/ada/lib-writ.adb
gcc/ada/lib-writ.ads

index d6d46eed0b07167f289aaf8032e5d6d4a9b7619c..e139e2d2c5dbff74f7333443bf5befc750c3238c 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        * gcc-interface/gigi.h (error_gnat_node): Delete.
index a4f952655f03316f8673325a58439e2b09e2d3e5..f035b45e913315d76b2588a3f801b1a1bfaa7512 100644 (file)
@@ -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),
index df391a8cc9966bf2319004736e34962f3bc9c699..9c7c270d1093a3502edf96d41fd8a6da9b18cd09 100644 (file)
@@ -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