aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-04-02 12:51:58 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-04-02 12:51:58 +0200
commitcf5ba8a881c32483bc11e05cc1ee3bcc990d32c6 (patch)
tree168cc4772edea64b02c164aad0c4c50eb0e7c6fe /gcc/ada/lib-writ.adb
parent5bd5034e244983cb1d6655a759efafcd5b6287aa (diff)
downloadgcc-cf5ba8a881c32483bc11e05cc1ee3bcc990d32c6.zip
gcc-cf5ba8a881c32483bc11e05cc1ee3bcc990d32c6.tar.gz
gcc-cf5ba8a881c32483bc11e05cc1ee3bcc990d32c6.tar.bz2
[multiple changes]
2012-04-02 Robert Dewar <dewar@adacore.com> * s-atopri.ads: Minor reformatting. 2012-04-02 Thomas Quinot <quinot@adacore.com> * sem_util.adb: Minor reformatting, minor code cleanup. 2012-04-02 Ed Schonberg <schonberg@adacore.com> * lib-xref.adb (Generate_Reference): For a reference to an operator symbol, set the sloc to point to the first character of the operator name, and not to the initial quaote. (Output_References): Ditto for the definition of an operator symbol. 2012-04-02 Vincent Celier <celier@adacore.com> * ali.adb (Scan_Ali): Recognize Z lines. Set Implicit_With_From_Instantiation to True in the With_Record for Z lines. * ali.ads (With_Record): New Boolean component Implicit_With_From_Instantiation, defaulted to False. * csinfo.adb: Indicate that Implicit_With_From_Instantiation is special * lib-writ.adb (Write_ALI): New array Implicit_With. (Collect_Withs): Set Implicit_With for the unit is it is not Yes. (Write_With_Lines): Write a Z line instead of a W line if Implicit_With is Yes for the unit. * sem_ch12.adb (Inherit_Context): Only add a unit in the context if it is not there yet. * sinfo.ads: New flag Implicit_With_From_Instantiation (Flag12) added. From-SVN: r186079
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 2d67ea0..e25355b 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- 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- --
@@ -196,6 +196,10 @@ package body Lib.Writ is
Elab_All_Des_Flags : array (Units.First .. Last_Unit) of Boolean;
-- Array of flags to show which units have Elaborate_All_Desirable set
+ type Yes_No is (Unknown, Yes, No);
+
+ Implicit_With : array (Units.First .. Last_Unit) of Yes_No;
+
Sdep_Table : Unit_Ref_Table (1 .. Pos (Last_Unit - Units.First + 2));
-- Sorted table of source dependencies. One extra entry in case we
-- have to add a dummy entry for System.
@@ -276,6 +280,15 @@ package body Lib.Writ is
else
Set_From_With_Type (Cunit_Entity (Unum));
end if;
+
+ if Implicit_With (Unum) /= Yes then
+ if Implicit_With_From_Instantiation (Item) then
+ Implicit_With (Unum) := Yes;
+
+ else
+ Implicit_With (Unum) := No;
+ end if;
+ end if;
end if;
Next (Item);
@@ -552,6 +565,7 @@ package body Lib.Writ is
Elab_All_Flags (J) := False;
Elab_Des_Flags (J) := False;
Elab_All_Des_Flags (J) := False;
+ Implicit_With (J) := Unknown;
end loop;
Collect_Withs (Unode);
@@ -770,10 +784,14 @@ package body Lib.Writ is
Uname := Units.Table (Unum).Unit_Name;
Fname := Units.Table (Unum).Unit_File_Name;
- if Ekind (Cunit_Entity (Unum)) = E_Package
+ if Implicit_With (Unum) = Yes then
+ Write_Info_Initiate ('Z');
+
+ elsif Ekind (Cunit_Entity (Unum)) = E_Package
and then From_With_Type (Cunit_Entity (Unum))
then
Write_Info_Initiate ('Y');
+
else
Write_Info_Initiate ('W');
end if;