diff options
-rw-r--r-- | gcc/ada/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/ada/a-tideio.ads | 9 | ||||
-rw-r--r-- | gcc/ada/a-tienio.ads | 32 | ||||
-rw-r--r-- | gcc/ada/a-tifiio.ads | 31 | ||||
-rw-r--r-- | gcc/ada/a-tiflio.ads | 7 | ||||
-rw-r--r-- | gcc/ada/a-tiinio.ads | 9 | ||||
-rw-r--r-- | gcc/ada/a-timoio.ads | 9 | ||||
-rw-r--r-- | gcc/ada/a-wtdeio.ads | 36 | ||||
-rw-r--r-- | gcc/ada/a-wtenio.ads | 30 | ||||
-rw-r--r-- | gcc/ada/a-wtfiio.ads | 30 | ||||
-rw-r--r-- | gcc/ada/a-wtflio.ads | 34 | ||||
-rw-r--r-- | gcc/ada/a-wtinio.ads | 4 | ||||
-rw-r--r-- | gcc/ada/a-wtmoio.ads | 36 | ||||
-rw-r--r-- | gcc/ada/a-ztcoau.ads | 24 | ||||
-rw-r--r-- | gcc/ada/a-ztdeio.ads | 36 | ||||
-rw-r--r-- | gcc/ada/a-ztenio.ads | 37 | ||||
-rw-r--r-- | gcc/ada/a-ztfiio.ads | 30 | ||||
-rw-r--r-- | gcc/ada/a-ztflio.ads | 34 | ||||
-rw-r--r-- | gcc/ada/a-ztinio.ads | 4 | ||||
-rw-r--r-- | gcc/ada/a-ztmoio.ads | 36 | ||||
-rw-r--r-- | gcc/ada/debug.adb | 8 | ||||
-rw-r--r-- | gcc/ada/exp_disp.adb | 2 | ||||
-rw-r--r-- | gcc/ada/rtsfind.adb | 292 | ||||
-rw-r--r-- | gcc/ada/rtsfind.ads | 38 | ||||
-rw-r--r-- | gcc/ada/sem_ch12.adb | 6 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 4 | ||||
-rw-r--r-- | gcc/ada/snames.ads-tmpl | 2 | ||||
-rw-r--r-- | gcc/ada/sprint.adb | 2 |
28 files changed, 293 insertions, 540 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 816b596c61f..003bde3a19c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,16 @@ 2014-07-17 Robert Dewar <dewar@adacore.com> + * debug.adb: Remove -gnatdQ. + * exp_disp.adb: Remove -gnatdQ. + * a-ztenio.ads, a-wtinio.ads, a-wtmoio.ads, a-ztcoau.ads, a-tiinio.ads, + a-wtfiio.ads, a-timoio.ads, sem_ch12.adb, a-tifiio.ads, a-ztinio.ads, + rtsfind.adb, rtsfind.ads, a-ztmoio.ads, a-wtdeio.ads, a-ztfiio.ads, + a-tideio.ads, a-wtflio.ads, a-ztdeio.ads, sem_ch8.adb, a-tiflio.ads, + sprint.adb, a-ztflio.ads, snames.ads-tmpl, a-wtenio.ads, + a-tienio.ads: Rename Text_IO_Kludge to Text_IO_Special_Unit. + +2014-07-17 Robert Dewar <dewar@adacore.com> + * back_end.adb: Minor reformatting and comment additions. * checks.ads, checks.adb (Duplicated_Tag_Checks_Suppressed): New function. diff --git a/gcc/ada/a-tideio.ads b/gcc/ada/a-tideio.ads index 8bb81590b3b..47acdd6ab45 100644 --- a/gcc/ada/a-tideio.ads +++ b/gcc/ada/a-tideio.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -35,9 +35,10 @@ -- In Ada 95, the package Ada.Text_IO.Decimal_IO is a subpackage of Text_IO. -- This is for compatibility with Ada 83. In GNAT we make it a child package --- to avoid loading the necessary code if Decimal_IO is not instantiated. See --- routine Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- to avoid loading the necessary code if Decimal_IO is not instantiated. +-- See routine Rtsfind.Check_Text_IO_Special_Unit for a description of how +-- we patch up the difference in semantics so that it is invisible to the +-- Ada programmer. private generic type Num is delta <> digits <>; diff --git a/gcc/ada/a-tienio.ads b/gcc/ada/a-tienio.ads index 4c7a9b52ca4..68f4694321b 100644 --- a/gcc/ada/a-tienio.ads +++ b/gcc/ada/a-tienio.ads @@ -6,39 +6,19 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- In Ada 95, the package Ada.Text_IO.Enumeration_IO is a subpackage of -- Text_IO. This is for compatibility with Ada 83. In GNAT we make it a -- child package to avoid loading the necessary code if Enumeration_IO is --- not instantiated. See routine Rtsfind.Text_IO_Kludge for a description --- of how we patch up the difference in semantics so that it is invisible --- to the Ada programmer. +-- not instantiated. See routine Rtsfind.Check_Text_IO_Special_Unit for a +-- description of how we patch up the difference in semantics so that it +-- is invisible to the Ada programmer. private generic type Enum is (<>); diff --git a/gcc/ada/a-tifiio.ads b/gcc/ada/a-tifiio.ads index 6225d0084b7..265600dbe46 100644 --- a/gcc/ada/a-tifiio.ads +++ b/gcc/ada/a-tifiio.ads @@ -6,38 +6,19 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- In Ada 95, the package Ada.Text_IO.Fixed_IO is a subpackage of Text_IO. -- This is for compatibility with Ada 83. In GNAT we make it a child package -- to avoid loading the necessary code if Fixed_IO is not instantiated. See --- routine Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- routine Rtsfind.Check_Text_IO_Special_Unit for a description of how we +-- patch up the difference in semantics so that it is invisible to the Ada +-- programmer. private generic type Num is delta <>; diff --git a/gcc/ada/a-tiflio.ads b/gcc/ada/a-tiflio.ads index 0df8e53b3df..89eec9932cf 100644 --- a/gcc/ada/a-tiflio.ads +++ b/gcc/ada/a-tiflio.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -36,8 +36,9 @@ -- In Ada 95, the package Ada.Text_IO.Float_IO is a subpackage of Text_IO. -- This is for compatibility with Ada 83. In GNAT we make it a child package -- to avoid loading the necessary code if Float_IO is not instantiated. See --- routine Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- routine Rtsfind.Check_Text_IO_Special_Unit for a description of how we +-- patch up the difference in semantics so that it is invisible to the Ada +-- programmer. private generic type Num is digits <>; diff --git a/gcc/ada/a-tiinio.ads b/gcc/ada/a-tiinio.ads index 9d659f33e09..459d6fe5a6e 100644 --- a/gcc/ada/a-tiinio.ads +++ b/gcc/ada/a-tiinio.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -35,9 +35,10 @@ -- In Ada 95, the package Ada.Text_IO.Integer_IO is a subpackage of Text_IO. -- This is for compatibility with Ada 83. In GNAT we make it a child package --- to avoid loading the necessary code if Integer_IO is not instantiated. See --- routine Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- to avoid loading the necessary code if Integer_IO is not instantiated. +-- See routine Rtsfind.Check_Text_IO_Special_Unit for a description of how +-- we patch up the difference in semantics so that it is invisible to the +-- Ada programmer. private generic type Num is range <>; diff --git a/gcc/ada/a-timoio.ads b/gcc/ada/a-timoio.ads index 90b84fffb3e..112adf4b821 100644 --- a/gcc/ada/a-timoio.ads +++ b/gcc/ada/a-timoio.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1993-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1993-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -35,9 +35,10 @@ -- In Ada 95, the package Ada.Text_IO.Modular_IO is a subpackage of Text_IO. -- This is for compatibility with Ada 83. In GNAT we make it a child package --- to avoid loading the necessary code if Modular_IO is not instantiated. See --- routine Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- to avoid loading the necessary code if Modular_IO is not instantiated. +-- See routine Rtsfind.Check_Text_IO_Special_Unit for a description of how +-- we patch up the difference in semantics so that it is invisible to the +-- Ada programmer. private generic type Num is mod <>; diff --git a/gcc/ada/a-wtdeio.ads b/gcc/ada/a-wtdeio.ads index 23f74f03674..dbeb80a077b 100644 --- a/gcc/ada/a-wtdeio.ads +++ b/gcc/ada/a-wtdeio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ --- In Ada 95, the package Ada.Wide_Text_IO.Decimal_IO is a subpackage of --- Wide_Text_IO. In GNAT we make it a child package to avoid loading the --- necessary code if Decimal_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- In Ada 95, the package Ada.Wide_Text_IO.Decimal_IO is a subpackage +-- of Wide_Text_IO. In GNAT we make it a child package to avoid loading +-- the necessary code if Decimal_IO is not instantiated. See the routine +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is delta <> digits <>; diff --git a/gcc/ada/a-wtenio.ads b/gcc/ada/a-wtenio.ads index 3b6818450d9..f0a1c0be135 100644 --- a/gcc/ada/a-wtenio.ads +++ b/gcc/ada/a-wtenio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- In Ada 95, the package Ada.Wide_Text_IO.Enumeration_IO is a subpackage -- of Wide_Text_IO. In GNAT we make it a child package to avoid loading the -- necessary code if Enumeration_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the difference --- in semantics so that it is invisible to the Ada programmer. +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Enum is (<>); diff --git a/gcc/ada/a-wtfiio.ads b/gcc/ada/a-wtfiio.ads index 39f85416eaf..939229e9daf 100644 --- a/gcc/ada/a-wtfiio.ads +++ b/gcc/ada/a-wtfiio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- In Ada 95, the package Ada.Wide_Text_IO.Fixed_IO is a subpackage of -- Wide_Text_IO. In GNAT we make it a child package to avoid loading -- the necessary code if Fixed_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is delta <>; diff --git a/gcc/ada/a-wtflio.ads b/gcc/ada/a-wtflio.ads index 8b6265de12e..445ad265195 100644 --- a/gcc/ada/a-wtflio.ads +++ b/gcc/ada/a-wtflio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ --- In Ada 95, the package Ada.Wide_Text_IO.Float_IO is a subpackage --- of Wide_Text_IO. In GNAT we make it a child package to avoid loading +-- In Ada 95, the package Ada.Wide_Text_IO.Float_IO is a subpackage of +-- Wide_Text_IO. In GNAT we make it a child package to avoid loading -- the necessary code if Float_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is digits <>; diff --git a/gcc/ada/a-wtinio.ads b/gcc/ada/a-wtinio.ads index b078ee379bb..c2821db60dc 100644 --- a/gcc/ada/a-wtinio.ads +++ b/gcc/ada/a-wtinio.ads @@ -16,8 +16,8 @@ -- In Ada 95, the package Ada.Wide_Text_IO.Integer_IO is a subpackage -- of Wide_Text_IO. In GNAT we make it a child package to avoid loading -- the necessary code if Integer_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is range <>; diff --git a/gcc/ada/a-wtmoio.ads b/gcc/ada/a-wtmoio.ads index 6e85c2bb753..9ea1620d1a5 100644 --- a/gcc/ada/a-wtmoio.ads +++ b/gcc/ada/a-wtmoio.ads @@ -6,38 +6,20 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ --- In Ada 95, the package Ada.Wide_Text_IO.Modular_IO is a subpackage of --- Wide_Text_IO. In GNAT we make it a child package to avoid loading the --- necessary code if Modular_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- In Ada 95, the package Ada.Wide_Text_IO.Modular_IO is a subpackage +-- of Wide_Text_IO. In GNAT we make it a child package to avoid loading +-- the necessary code if Modular_IO is not instantiated. See the routine +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is mod <>; diff --git a/gcc/ada/a-ztcoau.ads b/gcc/ada/a-ztcoau.ads index 42322401fda..b68c38b18cc 100644 --- a/gcc/ada/a-ztcoau.ads +++ b/gcc/ada/a-ztcoau.ads @@ -6,26 +6,10 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ diff --git a/gcc/ada/a-ztdeio.ads b/gcc/ada/a-ztdeio.ads index 00ea5d742ca..efe24da4a6c 100644 --- a/gcc/ada/a-ztdeio.ads +++ b/gcc/ada/a-ztdeio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ --- In Ada 95, the package Ada.Wide_Wide_Text_IO.Decimal_IO is a subpackage of --- Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading the --- necessary code if Decimal_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the difference --- in semantics so that it is invisible to the Ada programmer. +-- In Ada 95, the package Ada.Wide_Wide_Text_IO.Decimal_IO is a subpackage +-- of Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading +-- the necessary code if Decimal_IO is not instantiated. See the routine +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is delta <> digits <>; diff --git a/gcc/ada/a-ztenio.ads b/gcc/ada/a-ztenio.ads index 6c81d6f9ea5..5a003512d2e 100644 --- a/gcc/ada/a-ztenio.ads +++ b/gcc/ada/a-ztenio.ads @@ -6,39 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ --- In Ada 95, the package Ada.Wide_Wide_Text_IO.Enumeration_IO is a --- subpackage of Wide_Wide_Text_IO. In GNAT we make it a child package to --- avoid loading the necessary code if Enumeration_IO is not instantiated. --- See the routine Rtsfind.Text_IO_Kludge for a description of how we patch --- up the difference in semantics so that it is invisible to the Ada --- programmer. +-- In Ada 95, the package Ada.Wide_Wide_Text_IO.Enumeration_IO is a subpackage +-- of Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading +-- the necessary code if Enumeration_IO is not instantiated. See the routine +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up the +-- difference in semantics so that it is invisible to the Ada programmer. private generic type Enum is (<>); diff --git a/gcc/ada/a-ztfiio.ads b/gcc/ada/a-ztfiio.ads index cd72fc6ac9e..498565c3984 100644 --- a/gcc/ada/a-ztfiio.ads +++ b/gcc/ada/a-ztfiio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- In Ada 95, the package Ada.Wide_Wide_Text_IO.Fixed_IO is a subpackage of -- Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading -- the necessary code if Fixed_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is delta <>; diff --git a/gcc/ada/a-ztflio.ads b/gcc/ada/a-ztflio.ads index 00b0b05bc08..ca3f86b7716 100644 --- a/gcc/ada/a-ztflio.ads +++ b/gcc/ada/a-ztflio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ --- In Ada 95, the package Ada.Wide_Wide_Text_IO.Float_IO is a subpackage --- of Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading +-- In Ada 95, the package Ada.Wide_Wide_Text_IO.Float_IO is a subpackage of +-- Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading -- the necessary code if Float_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is digits <>; diff --git a/gcc/ada/a-ztinio.ads b/gcc/ada/a-ztinio.ads index 4358e7b1e68..2434f8b3e43 100644 --- a/gcc/ada/a-ztinio.ads +++ b/gcc/ada/a-ztinio.ads @@ -16,8 +16,8 @@ -- In Ada 95, the package Ada.Wide_Wide_Text_IO.Integer_IO is a subpackage -- of Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading -- the necessary code if Integer_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is range <>; diff --git a/gcc/ada/a-ztmoio.ads b/gcc/ada/a-ztmoio.ads index 27dec484dcc..11aeaefec02 100644 --- a/gcc/ada/a-ztmoio.ads +++ b/gcc/ada/a-ztmoio.ads @@ -6,38 +6,18 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- --- -- -- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- --- 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- -- --- ware Foundation; either version 3, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- <http://www.gnu.org/licenses/>. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ --- In Ada 95, the package Ada.Wide_Wide_Text_IO.Modular_IO is a subpackage of --- Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading the --- necessary code if Modular_IO is not instantiated. See the routine --- Rtsfind.Text_IO_Kludge for a description of how we patch up the --- difference in semantics so that it is invisible to the Ada programmer. +-- In Ada 95, the package Ada.Wide_Wide_Text_IO.Modular_IO is a subpackage +-- of Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading +-- the necessary code if Modular_IO is not instantiated. See the routine +-- Rtsfind.Check_Text_IO_Special_Unit for a description of how we patch up +-- the difference in semantics so that it is invisible to the Ada programmer. private generic type Num is mod <>; diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index e54b631d241..869b8cd09a0 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -80,7 +80,7 @@ package body Debug is -- dN No file name information in exception messages -- dO Output immediate error messages -- dP Do not check for controlled objects in preelaborable packages - -- dQ Do not generate runtime check for duplicated external tag + -- dQ -- dR Bypass check for correct version of s-rpc -- dS Never convert numbers to machine numbers in Sem_Eval -- dT Convert to machine numbers only for constant declarations @@ -438,12 +438,6 @@ package body Debug is -- in preelaborable packages, but this restriction is a huge pain, -- especially in the predefined library units. - -- dQ Eliminate check for duplicate external tags. This check was added - -- as per AI 0113, and causes some backward compatibility problems. - -- It is never legitimate to have duplicate external tags, so the - -- check is certainly valid, but this debug switch can be useful for - -- enabling previous behavior of ignoring this problem. - -- dR Bypass the check for a proper version of s-rpc being present -- to use the -gnatz? switch. This allows debugging of the use -- of stubs generation without needing to have GLADE (or some diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 0cf6eb63256..8da934f3d34 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -6226,7 +6226,6 @@ package body Exp_Disp is if not No_Run_Time_Mode and then Ada_Version >= Ada_2005 and then RTE_Available (RE_Check_TSD) - and then not Debug_Flag_QQ and then not Duplicated_Tag_Checks_Suppressed (Typ) then Append_To (Elab_Code, @@ -6815,7 +6814,6 @@ package body Exp_Disp is if Ada_Version >= Ada_2005 and then Is_Library_Level_Entity (Typ) and then RTE_Available (RE_Check_TSD) - and then not Debug_Flag_QQ and then not Duplicated_Tag_Checks_Suppressed (Typ) then Append_To (Result, diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index ad3713376d3..499b167bb0a 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -173,9 +173,9 @@ package body Rtsfind is -- for the Is_Potentially_Use_Visible flag of the entity for the loaded -- unit (if it is indeed loaded). A value of False means nothing special -- need be done. A value of True indicates that this flag must be set to - -- True. It is needed only in the Text_IO_Kludge procedure, which may - -- materialize an entity of Text_IO (or [Wide_]Wide_Text_IO) that was - -- previously unknown. Id is the RE_Id value of the entity which was + -- True. It is needed only in the Check_Text_IO_Special_Unit procedure, + -- which may materialize an entity of Text_IO (or [Wide_]Wide_Text_IO) that + -- was previously unknown. Id is the RE_Id value of the entity which was -- originally requested. Id is used only for error message detail, and if -- it is RE_Null, then the attempt to output the entity name is ignored. @@ -264,6 +264,144 @@ package body Rtsfind is end if; end Check_CRT; + -------------------------------- + -- Check_Text_IO_Special_Unit -- + -------------------------------- + + procedure Check_Text_IO_Special_Unit (Nam : Node_Id) is + Chrs : Name_Id; + + type Name_Map_Type is array (Text_IO_Package_Name) of RTU_Id; + + Name_Map : constant Name_Map_Type := Name_Map_Type'( + Name_Decimal_IO => Ada_Text_IO_Decimal_IO, + Name_Enumeration_IO => Ada_Text_IO_Enumeration_IO, + Name_Fixed_IO => Ada_Text_IO_Fixed_IO, + Name_Float_IO => Ada_Text_IO_Float_IO, + Name_Integer_IO => Ada_Text_IO_Integer_IO, + Name_Modular_IO => Ada_Text_IO_Modular_IO); + + Wide_Name_Map : constant Name_Map_Type := Name_Map_Type'( + Name_Decimal_IO => Ada_Wide_Text_IO_Decimal_IO, + Name_Enumeration_IO => Ada_Wide_Text_IO_Enumeration_IO, + Name_Fixed_IO => Ada_Wide_Text_IO_Fixed_IO, + Name_Float_IO => Ada_Wide_Text_IO_Float_IO, + Name_Integer_IO => Ada_Wide_Text_IO_Integer_IO, + Name_Modular_IO => Ada_Wide_Text_IO_Modular_IO); + + Wide_Wide_Name_Map : constant Name_Map_Type := Name_Map_Type'( + Name_Decimal_IO => Ada_Wide_Wide_Text_IO_Decimal_IO, + Name_Enumeration_IO => Ada_Wide_Wide_Text_IO_Enumeration_IO, + Name_Fixed_IO => Ada_Wide_Wide_Text_IO_Fixed_IO, + Name_Float_IO => Ada_Wide_Wide_Text_IO_Float_IO, + Name_Integer_IO => Ada_Wide_Wide_Text_IO_Integer_IO, + Name_Modular_IO => Ada_Wide_Wide_Text_IO_Modular_IO); + + To_Load : RTU_Id; + -- Unit to be loaded, from one of the above maps + + begin + -- Nothing to do if name is not an identifier or a selected component + -- whose selector_name is an identifier. + + if Nkind (Nam) = N_Identifier then + Chrs := Chars (Nam); + + elsif Nkind (Nam) = N_Selected_Component + and then Nkind (Selector_Name (Nam)) = N_Identifier + then + Chrs := Chars (Selector_Name (Nam)); + + else + return; + end if; + + -- Nothing to do if name is not one of the Text_IO subpackages + -- Otherwise look through loaded units, and if we find Text_IO + -- or [Wide_]Wide_Text_IO already loaded, then load the proper child. + + if Chrs in Text_IO_Package_Name then + for U in Main_Unit .. Last_Unit loop + Get_Name_String (Unit_File_Name (U)); + + if Name_Len = 12 then + + -- Here is where we do the loads if we find one of the units + -- Ada.Text_IO or Ada.[Wide_]Wide_Text_IO. An interesting + -- detail is that these units may already be used (i.e. their + -- In_Use flags may be set). Normally when the In_Use flag is + -- set, the Is_Potentially_Use_Visible flag of all entities in + -- the package is set, but the new entity we are mysteriously + -- adding was not there to have its flag set at the time. So + -- that's why we pass the extra parameter to RTU_Find, to make + -- sure the flag does get set now. Given that those generic + -- packages are in fact child units, we must indicate that + -- they are visible. + + if Name_Buffer (1 .. 12) = "a-textio.ads" then + To_Load := Name_Map (Chrs); + + elsif Name_Buffer (1 .. 12) = "a-witeio.ads" then + To_Load := Wide_Name_Map (Chrs); + + elsif Name_Buffer (1 .. 12) = "a-ztexio.ads" then + To_Load := Wide_Wide_Name_Map (Chrs); + + else + goto Continue; + end if; + + Load_RTU (To_Load, Use_Setting => In_Use (Cunit_Entity (U))); + Set_Is_Visible_Lib_Unit (RT_Unit_Table (To_Load).Entity); + + -- Prevent creation of an implicit 'with' from (for example) + -- Ada.Wide_Text_IO.Integer_IO to Ada.Text_IO.Integer_IO, + -- because these could create cycles. First check whether the + -- simple names match ("integer_io" = "integer_io"), and then + -- check whether the parent is indeed one of the + -- [[Wide_]Wide_]Text_IO packages. + + if Chrs = Chars (Cunit_Entity (Current_Sem_Unit)) then + declare + Parent_Name : constant Unit_Name_Type := + Get_Parent_Spec_Name + (Unit_Name (Current_Sem_Unit)); + + begin + if Parent_Name /= No_Unit_Name then + Get_Name_String (Parent_Name); + + declare + P : String renames Name_Buffer (1 .. Name_Len); + begin + if P = "ada.text_io%s" or else + P = "ada.wide_text_io%s" or else + P = "ada.wide_wide_text_io%s" + then + goto Continue; + end if; + end; + end if; + end; + end if; + + -- Add an implicit with clause from the current unit to the + -- [[Wide_]Wide_]Text_IO child (if necessary). + + Maybe_Add_With (RT_Unit_Table (To_Load)); + end if; + + <<Continue>> null; + end loop; + end if; + + exception + -- Generate error message if run-time unit not available + + when RE_Not_Available => + Error_Msg_N ("& not available", Nam); + end Check_Text_IO_Special_Unit; + ------------------------ -- Entity_Not_Defined -- ------------------------ @@ -515,11 +653,11 @@ package body Rtsfind is return Present (E) and then E = Ent; end Is_RTU; - ---------------------------- - -- Is_Text_IO_Kludge_Unit -- - ---------------------------- + ----------------------------- + -- Is_Text_IO_Special_Unit -- + ----------------------------- - function Is_Text_IO_Kludge_Unit (Nam : Node_Id) return Boolean is + function Is_Text_IO_Special_Unit (Nam : Node_Id) return Boolean is Prf : Node_Id; Sel : Node_Id; @@ -549,7 +687,7 @@ package body Rtsfind is Name_Wide_Wide_Text_IO) and then Nkind (Sel) = N_Identifier and then Chars (Sel) in Text_IO_Package_Name; - end Is_Text_IO_Kludge_Unit; + end Is_Text_IO_Special_Unit; --------------- -- Load_Fail -- @@ -1381,142 +1519,4 @@ package body Rtsfind is end loop; end Set_RTU_Loaded; - -------------------- - -- Text_IO_Kludge -- - -------------------- - - procedure Text_IO_Kludge (Nam : Node_Id) is - Chrs : Name_Id; - - type Name_Map_Type is array (Text_IO_Package_Name) of RTU_Id; - - Name_Map : constant Name_Map_Type := Name_Map_Type'( - Name_Decimal_IO => Ada_Text_IO_Decimal_IO, - Name_Enumeration_IO => Ada_Text_IO_Enumeration_IO, - Name_Fixed_IO => Ada_Text_IO_Fixed_IO, - Name_Float_IO => Ada_Text_IO_Float_IO, - Name_Integer_IO => Ada_Text_IO_Integer_IO, - Name_Modular_IO => Ada_Text_IO_Modular_IO); - - Wide_Name_Map : constant Name_Map_Type := Name_Map_Type'( - Name_Decimal_IO => Ada_Wide_Text_IO_Decimal_IO, - Name_Enumeration_IO => Ada_Wide_Text_IO_Enumeration_IO, - Name_Fixed_IO => Ada_Wide_Text_IO_Fixed_IO, - Name_Float_IO => Ada_Wide_Text_IO_Float_IO, - Name_Integer_IO => Ada_Wide_Text_IO_Integer_IO, - Name_Modular_IO => Ada_Wide_Text_IO_Modular_IO); - - Wide_Wide_Name_Map : constant Name_Map_Type := Name_Map_Type'( - Name_Decimal_IO => Ada_Wide_Wide_Text_IO_Decimal_IO, - Name_Enumeration_IO => Ada_Wide_Wide_Text_IO_Enumeration_IO, - Name_Fixed_IO => Ada_Wide_Wide_Text_IO_Fixed_IO, - Name_Float_IO => Ada_Wide_Wide_Text_IO_Float_IO, - Name_Integer_IO => Ada_Wide_Wide_Text_IO_Integer_IO, - Name_Modular_IO => Ada_Wide_Wide_Text_IO_Modular_IO); - - To_Load : RTU_Id; - -- Unit to be loaded, from one of the above maps - - begin - -- Nothing to do if name is not an identifier or a selected component - -- whose selector_name is an identifier. - - if Nkind (Nam) = N_Identifier then - Chrs := Chars (Nam); - - elsif Nkind (Nam) = N_Selected_Component - and then Nkind (Selector_Name (Nam)) = N_Identifier - then - Chrs := Chars (Selector_Name (Nam)); - - else - return; - end if; - - -- Nothing to do if name is not one of the Text_IO subpackages - -- Otherwise look through loaded units, and if we find Text_IO - -- or [Wide_]Wide_Text_IO already loaded, then load the proper child. - - if Chrs in Text_IO_Package_Name then - for U in Main_Unit .. Last_Unit loop - Get_Name_String (Unit_File_Name (U)); - - if Name_Len = 12 then - - -- Here is where we do the loads if we find one of the units - -- Ada.Text_IO or Ada.[Wide_]Wide_Text_IO. An interesting - -- detail is that these units may already be used (i.e. their - -- In_Use flags may be set). Normally when the In_Use flag is - -- set, the Is_Potentially_Use_Visible flag of all entities in - -- the package is set, but the new entity we are mysteriously - -- adding was not there to have its flag set at the time. So - -- that's why we pass the extra parameter to RTU_Find, to make - -- sure the flag does get set now. Given that those generic - -- packages are in fact child units, we must indicate that - -- they are visible. - - if Name_Buffer (1 .. 12) = "a-textio.ads" then - To_Load := Name_Map (Chrs); - - elsif Name_Buffer (1 .. 12) = "a-witeio.ads" then - To_Load := Wide_Name_Map (Chrs); - - elsif Name_Buffer (1 .. 12) = "a-ztexio.ads" then - To_Load := Wide_Wide_Name_Map (Chrs); - - else - goto Continue; - end if; - - Load_RTU (To_Load, Use_Setting => In_Use (Cunit_Entity (U))); - Set_Is_Visible_Lib_Unit (RT_Unit_Table (To_Load).Entity); - - -- Prevent creation of an implicit 'with' from (for example) - -- Ada.Wide_Text_IO.Integer_IO to Ada.Text_IO.Integer_IO, - -- because these could create cycles. First check whether the - -- simple names match ("integer_io" = "integer_io"), and then - -- check whether the parent is indeed one of the - -- [[Wide_]Wide_]Text_IO packages. - - if Chrs = Chars (Cunit_Entity (Current_Sem_Unit)) then - declare - Parent_Name : constant Unit_Name_Type := - Get_Parent_Spec_Name - (Unit_Name (Current_Sem_Unit)); - - begin - if Parent_Name /= No_Unit_Name then - Get_Name_String (Parent_Name); - - declare - P : String renames Name_Buffer (1 .. Name_Len); - begin - if P = "ada.text_io%s" or else - P = "ada.wide_text_io%s" or else - P = "ada.wide_wide_text_io%s" - then - goto Continue; - end if; - end; - end if; - end; - end if; - - -- Add an implicit with clause from the current unit to the - -- [[Wide_]Wide_]Text_IO child (if necessary). - - Maybe_Add_With (RT_Unit_Table (To_Load)); - end if; - - <<Continue>> null; - end loop; - end if; - - exception - -- Generate error message if run-time unit not available - - when RE_Not_Available => - Error_Msg_N ("& not available", Nam); - end Text_IO_Kludge; - end Rtsfind; diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index 1f50db32dab..db4dd0b239c 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -169,7 +169,7 @@ package Rtsfind is Ada_Strings_Wide_Wide_Superbounded, Ada_Strings_Unbounded, - -- Children of Ada.Text_IO (for Text_IO_Kludge) + -- Children of Ada.Text_IO (for Check_Text_IO_Special_Unit) Ada_Text_IO_Decimal_IO, Ada_Text_IO_Enumeration_IO, @@ -178,7 +178,7 @@ package Rtsfind is Ada_Text_IO_Integer_IO, Ada_Text_IO_Modular_IO, - -- Children of Ada.Wide_Text_IO (for Text_IO_Kludge) + -- Children of Ada.Wide_Text_IO (for Check_Text_IO_Special_Unit) Ada_Wide_Text_IO_Decimal_IO, Ada_Wide_Text_IO_Enumeration_IO, @@ -187,7 +187,7 @@ package Rtsfind is Ada_Wide_Text_IO_Integer_IO, Ada_Wide_Text_IO_Modular_IO, - -- Children of Ada.Wide_Wide_Text_IO (for Text_IO_Kludge) + -- Children of Ada.Wide_Wide_Text_IO (for Check_Text_IO_Special_Unit) Ada_Wide_Wide_Text_IO_Decimal_IO, Ada_Wide_Wide_Text_IO_Enumeration_IO, @@ -3204,6 +3204,20 @@ package Rtsfind is -- occur either because the file in which the entity should be found -- does not exist, or because the entity is not present in the file. + procedure Check_Text_IO_Special_Unit (Nam : Node_Id); + -- In Ada 83, and hence for compatibility in later versions of Ada, package + -- Text_IO has generic subpackages (e.g. Integer_IO). They really should be + -- child packages, and in GNAT, they *are* child packages. To maintain the + -- required compatibility, this routine is called for package renamings and + -- generic instantiations, with the simple name of the referenced package. + -- If Text_IO has been with'ed and if the simple name of Nam matches + -- one of the subpackages of Text_IO, then this subpackage is with'ed + -- automatically. The important result of this approach is that Text_IO + -- does not drag in all the code for the subpackages unless they are used. + -- Our test is a little crude, and could drag in stuff when it is not + -- necessary, but that is acceptable. Wide_[Wide_]Text_IO is handled in + -- a similar manner. + procedure Initialize; -- Procedure to initialize data structures used by RTE. Called at the -- start of processing a new main source file. Must be called after @@ -3226,11 +3240,11 @@ package Rtsfind is -- entity id values are compared and True is returned if Ent is the -- entity for this unit. - function Is_Text_IO_Kludge_Unit (Nam : Node_Id) return Boolean; + function Is_Text_IO_Special_Unit (Nam : Node_Id) return Boolean; -- Returns True if the given Nam is an Expanded Name, whose Prefix is Ada, -- and whose selector is either Text_IO.xxx or Wide_Text_IO.xxx or -- Wide_Wide_Text_IO.xxx, where xxx is one of the subpackages of Text_IO - -- that is specially handled as described below for Text_IO_Kludge. + -- that is specially handled as described for Check_Text_IO_Special_Unit. function RTE (E : RE_Id) return Entity_Id; -- Given the entity defined in the above tables, as identified by the @@ -3306,18 +3320,4 @@ package Rtsfind is procedure Set_RTU_Loaded (N : Node_Id); -- Register the predefined unit N as already loaded - procedure Text_IO_Kludge (Nam : Node_Id); - -- In Ada 83, and hence for compatibility in Ada 9X, package Text_IO has - -- generic subpackages (e.g. Integer_IO). They really should be child - -- packages, and in GNAT, they *are* child packages. To maintain the - -- required compatibility, this routine is called for package renamings - -- and generic instantiations, with the simple name of the referenced - -- package. If Text_IO has been with'ed and if the simple name of Nam - -- matches one of the subpackages of Text_IO, then this subpackage is - -- with'ed automatically. The important result of this approach is that - -- Text_IO does not drag in all the code for the subpackages unless they - -- are used. Our test is a little crude, and could drag in stuff when it - -- is not necessary, but that doesn't matter. Wide_[Wide_]Text_IO is - -- handled in a similar manner. - end Rtsfind; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 65ce631456e..49adf852a52 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -2362,7 +2362,7 @@ package body Sem_Ch12 is -- Start of processing for Analyze_Formal_Package_Declaration begin - Text_IO_Kludge (Gen_Id); + Check_Text_IO_Special_Unit (Gen_Id); Init_Env; Check_Generic_Child_Unit (Gen_Id, Parent_Installed); @@ -3426,7 +3426,7 @@ package body Sem_Ch12 is -- Very first thing: apply the special kludge for Text_IO processing -- in case we are instantiating one of the children of [Wide_]Text_IO. - Text_IO_Kludge (Name (N)); + Check_Text_IO_Special_Unit (Name (N)); -- Make node global for error reporting @@ -4675,7 +4675,7 @@ package body Sem_Ch12 is -- Of course such an instantiation is bogus (these are packages, not -- subprograms), but we get a better error message if we do this. - Text_IO_Kludge (Gen_Id); + Check_Text_IO_Special_Unit (Gen_Id); -- Make node global for error reporting diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index fb69ac69431..42a14872fde 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -628,7 +628,7 @@ package body Sem_Ch8 is -- Apply the Text_IO Kludge here, since we may be renaming one of the -- subpackages of Text_IO, then join common routine. - Text_IO_Kludge (Name (N)); + Check_Text_IO_Special_Unit (Name (N)); Analyze_Generic_Renaming (N, E_Generic_Package); end Analyze_Generic_Package_Renaming; @@ -1319,7 +1319,7 @@ package body Sem_Ch8 is -- Apply Text_IO kludge here since we may be renaming a child of Text_IO - Text_IO_Kludge (Name (N)); + Check_Text_IO_Special_Unit (Name (N)); if Current_Scope /= Standard_Standard then Set_Is_Pure (New_P, Is_Pure (Current_Scope)); diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index ed9e75ed45d..755c0169e85 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -209,7 +209,7 @@ package Snames is Name_Deallocate : constant Name_Id := N + $; Name_Dereference : constant Name_Id := N + $; - -- Names of Text_IO generic subpackages (see Rtsfind.Text_IO_Kludge) + -- Text_IO generic subpackages (see Rtsfind.Check_Text_IO_Special_Unit) First_Text_IO_Package : constant Name_Id := N + $; Name_Decimal_IO : constant Name_Id := N + $; diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index ec7f4caf6e7..8e33462d344 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -3307,7 +3307,7 @@ package body Sprint is -- correspond to the non-existent children of Text_IO. if Dump_Original_Only - and then Is_Text_IO_Kludge_Unit (Name (Node)) + and then Is_Text_IO_Special_Unit (Name (Node)) then null; |