Commit c97c0163 by Arnaud Charlet

[multiple changes]

2010-08-05  Robert Dewar  <dewar@adacore.com>

	* a-suezse.adb, a-suezse.ads, a-suezen.adb, a-suezen.ads: Removed.
	* a-suewse.adb, a-suewse.ads, a-suesen.adb, a-suesen.ads,
	a-suewen.adb, a-suewen.ads: New files.
	* Makefile.rtl, impunit.adb: Update implementation of Ada 2012 string
	encoding packages.
	* sem_elab.adb: Minor reformatting.

2010-08-05  Arnaud Charlet  <charlet@adacore.com>

	* sem_ch8.adb (Use_One_Type): Protect against empty scopes.
	* exp_util.adb (Component_May_Be_Bit_Aligned): Prevent assert failure
	in case of null Comp.

From-SVN: r162904
parent b94e425d
2010-08-05 Robert Dewar <dewar@adacore.com>
* a-suezse.adb, a-suezse.ads, a-suezen.adb, a-suezen.ads: Removed.
* a-suewse.adb, a-suewse.ads, a-suesen.adb, a-suesen.ads,
a-suewen.adb, a-suewen.ads: New files.
* Makefile.rtl, impunit.adb: Update implementation of Ada 2012 string
encoding packages.
* sem_elab.adb: Minor reformatting.
2010-08-05 Arnaud Charlet <charlet@adacore.com>
* sem_ch8.adb (Use_One_Type): Protect against empty scopes.
* exp_util.adb (Component_May_Be_Bit_Aligned): Prevent assert failure
in case of null Comp.
2010-08-05 Robert Dewar <dewar@adacore.com>
* errout.adb, a-suewen.adb, a-suezen.adb: Minor reformatting.
2010-08-05 Gary Dismukes <dismukes@adacore.com>
......
......@@ -227,8 +227,9 @@ GNATRTL_NONTASKING_OBJS= \
a-stzsup$(objext) \
a-stzunb$(objext) \
a-suenco$(objext) \
a-suewen$(objext) \
a-suezen$(objext) \
a-suesen$(objext) \
a-suewse$(objext) \
a-suezse$(objext) \
a-suteio$(objext) \
a-swbwha$(objext) \
a-swfwha$(objext) \
......
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.UTF_ENCODING.STRING_ENCODING --
-- --
-- S p e c --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This is an Ada 2012 package defined in AI05-0137-1. It is used for encoding
-- and decoding String values using UTF encodings. Note: this package is
-- consistent with Ada 95, and may be included in Ada 95 implementations.
package Ada.Strings.UTF_Encoding.String_Encoding is
pragma Pure (String_Encoding);
-- The encoding routines take a String as input and encode the result
-- using the specified UTF encoding method. The result includes a BOM if
-- the Output_BOM argument is set to True. All 256 values of type Character
-- are valid, so Encoding_Error cannot be raised for string input data.
function Encode
(Item : String;
Output_Scheme : Encoding_Scheme;
Output_BOM : Boolean := False) return UTF_String;
-- Encode String using UTF-8, UTF-16LE or UTF-16BE encoding as specified by
-- the Output_Scheme parameter.
function Encode
(Item : String;
Output_BOM : Boolean := False) return UTF_8_String;
-- Encode String using UTF-8 encoding
function Encode
(Item : String;
Output_BOM : Boolean := False) return UTF_16_Wide_String;
-- Encode String using UTF_16 encoding
-- The decoding routines take a UTF String as input, and return a decoded
-- Wide_String. If the UTF String starts with a BOM that matches the
-- encoding method, it is ignored. An incorrect BOM raises Encoding_Error,
-- as does a code out of range of type Character.
function Decode
(Item : UTF_String;
Input_Scheme : Encoding_Scheme) return String;
-- The input is encoded in UTF_8, UTF_16LE or UTF_16BE as specified by the
-- Input_Scheme parameter. It is decoded and returned as a String value.
-- Note: a convenient form for scheme may be Encoding (UTF_String).
function Decode
(Item : UTF_8_String) return String;
-- The input is encoded in UTF-8 and returned as a String value
function Decode
(Item : UTF_16_Wide_String) return String;
-- The input is encoded in UTF-16 and returned as a String value
end Ada.Strings.UTF_Encoding.String_Encoding;
......@@ -2,7 +2,7 @@
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.UTF_ENCODING.WIDE_ENCODING --
-- ADA.STRINGS.UTF_ENCODING.WIDE_STRING_ENCODING --
-- --
-- B o d y --
-- --
......@@ -10,28 +10,26 @@
-- --
-- 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 2, or (at your option) any later ver- --
-- 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. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- 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. --
-- --
------------------------------------------------------------------------------
package body Ada.Strings.UTF_Encoding.Wide_Encoding is
package body Ada.Strings.UTF_Encoding.Wide_String_Encoding is
use Interfaces;
------------
......@@ -369,4 +367,4 @@ package body Ada.Strings.UTF_Encoding.Wide_Encoding is
return Result;
end Encode;
end Ada.Strings.UTF_Encoding.Wide_Encoding;
end Ada.Strings.UTF_Encoding.Wide_String_Encoding;
......@@ -2,7 +2,7 @@
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.UTF_ENCODING.WIDE_ENCODING --
-- ADA.STRINGS.UTF_ENCODING.WIDE_STRING_ENCODING --
-- --
-- S p e c --
-- --
......@@ -17,8 +17,8 @@
-- and decoding Wide_String values using UTF encodings. Note: this package is
-- consistent with Ada 95, and may be included in Ada 95 implementations.
package Ada.Strings.UTF_Encoding.Wide_Encoding is
pragma Pure (Wide_Encoding);
package Ada.Strings.UTF_Encoding.Wide_String_Encoding is
pragma Pure (Wide_String_Encoding);
-- The encoding routines take a Wide_String as input and encode the result
-- using the specified UTF encoding method. The result includes a BOM if
......@@ -64,4 +64,4 @@ package Ada.Strings.UTF_Encoding.Wide_Encoding is
(Item : UTF_16_Wide_String) return Wide_String;
-- The input is encoded in UTF-16 and returned as a Wide_String value
end Ada.Strings.UTF_Encoding.Wide_Encoding;
end Ada.Strings.UTF_Encoding.Wide_String_Encoding;
......@@ -2,7 +2,7 @@
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.UTF_ENCODING.WIDE_WIDE_ENCODING --
-- ADA.STRINGS.UTF_ENCODING.WIDE_WIDE_STRING_ENCODING --
-- --
-- B o d y --
-- --
......@@ -10,28 +10,26 @@
-- --
-- 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 2, or (at your option) any later ver- --
-- 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. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- 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. --
-- --
------------------------------------------------------------------------------
package body Ada.Strings.UTF_Encoding.Wide_Wide_Encoding is
package body Ada.Strings.UTF_Encoding.Wide_Wide_String_Encoding is
use Interfaces;
------------
......@@ -428,4 +426,4 @@ package body Ada.Strings.UTF_Encoding.Wide_Wide_Encoding is
return Result (1 .. Len);
end Encode;
end Ada.Strings.UTF_Encoding.Wide_Wide_Encoding;
end Ada.Strings.UTF_Encoding.Wide_Wide_String_Encoding;
......@@ -2,7 +2,7 @@
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.UTF_ENCODING.WIDE_WIDE_ENCODING --
-- ADA.STRINGS.UTF_ENCODING.WIDE_WIDE_STRING_ENCODING --
-- --
-- S p e c --
-- --
......@@ -18,8 +18,8 @@
-- consistent with Ada 2005, and may be used in Ada 2005 mode, but cannot be
-- used in Ada 95 mode, since Wide_Wide_Character is an Ada 2005 feature.
package Ada.Strings.UTF_Encoding.Wide_Wide_Encoding is
pragma Pure (Wide_Wide_Encoding);
package Ada.Strings.UTF_Encoding.Wide_Wide_String_Encoding is
pragma Pure (Wide_Wide_String_Encoding);
-- The encoding routines take a Wide_Wide_String as input and encode the
-- result using the specified UTF encoding method. The result includes a
......@@ -61,4 +61,4 @@ package Ada.Strings.UTF_Encoding.Wide_Wide_Encoding is
(Item : UTF_16_Wide_String) return Wide_Wide_String;
-- The input is encoded in UTF-16 and returned as a Wide_String value
end Ada.Strings.UTF_Encoding.Wide_Wide_Encoding;
end Ada.Strings.UTF_Encoding.Wide_Wide_String_Encoding;
......@@ -904,17 +904,19 @@ package body Exp_Util is
----------------------------------
function Component_May_Be_Bit_Aligned (Comp : Entity_Id) return Boolean is
UT : constant Entity_Id := Underlying_Type (Etype (Comp));
UT : Entity_Id;
begin
-- If no component clause, then everything is fine, since the back end
-- never bit-misaligns by default, even if there is a pragma Packed for
-- the record.
if No (Component_Clause (Comp)) then
if No (Comp) or else No (Component_Clause (Comp)) then
return False;
end if;
UT := Underlying_Type (Etype (Comp));
-- It is only array and record types that cause trouble
if not Is_Record_Type (UT)
......
......@@ -173,13 +173,14 @@ package body Impunit is
"a-wichun", -- Ada.Wide_Characters.Unicode
"a-widcha", -- Ada.Wide_Characters
-- Note: strictly the next two should be Ada 2012 units, but it seems
-- Note: strictly the following should be Ada 2012 units, but it seems
-- harmless (and useful) to make then available in Ada 95 mode, since
-- they only deal with Wide_Character, not Wide_Wide_Character.
-- they do not deal with Wide_Wide_Character.
"a-stuten", -- Ada.Strings.UTF_Encoding
"a-suenco", -- Ada.Strings.UTF_Encoding.Conversions
"a-suewen", -- Ada.Strings.UTF_Encoding.Wide_Encoding
"a-suesen", -- Ada.Strings.UTF_Encoding.String_Encoding
"a-suewse", -- Ada.Strings.UTF_Encoding.Wide_String_Encoding
---------------------------
-- GNAT Special IO Units --
......@@ -470,7 +471,7 @@ package body Impunit is
-- Note: strictly the following should be Ada 2012 units, but it seems
-- harmless (and useful) to make then available in Ada 2005 mode.
"a-suezen", -- Ada.Strings.UTF_Encoding.Wide_Wide_Encoding
"a-suezse", -- Ada.Strings.UTF_Encoding.Wide_Wide_String_Encoding
---------------------------
-- GNAT Special IO Units --
......
......@@ -7622,9 +7622,10 @@ package body Sem_Ch8 is
begin
S1 := Scope (Ent1);
S2 := Scope (Ent2);
while S1 /= Standard_Standard
and then
S2 /= Standard_Standard
while Present (S1)
and then Present (S2)
and then S1 /= Standard_Standard
and then S2 /= Standard_Standard
loop
S1 := Scope (S1);
S2 := Scope (S2);
......
......@@ -2850,8 +2850,8 @@ package body Sem_Elab is
Typ : constant Entity_Id := Etype (N);
Chk : constant Boolean := Do_Range_Check (N);
R : constant Node_Id :=
Make_Raise_Program_Error (Loc,
R : constant Node_Id :=
Make_Raise_Program_Error (Loc,
Reason => PE_Access_Before_Elaboration);
Reloc_N : Node_Id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment