summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2018-09-26 09:16:59 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-09-26 09:16:59 +0000
commit05a84157e98dfb25500705c0bc2570139a01075f (patch)
treefe7a4be7651eb66ca19924080fef985322cfbc30 /gcc/ada/lib-writ.adb
parent738b83cd32bc4ebf651ef517cd880f04500d07af (diff)
downloadgcc-05a84157e98dfb25500705c0bc2570139a01075f.tar.gz
[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
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb11
1 files changed, 8 insertions, 3 deletions
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),