diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-08 11:04:46 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-08 11:04:46 +0100 |
commit | f62054146e86e792b6ce061bd418b9a2384ae9a5 (patch) | |
tree | f945e59cb67b3ec51266c32d20145f259333bf06 /gcc/ada/sinput-p.adb | |
parent | 88f7a9f691c91abf96a2ebe01e8e9dacb57d2426 (diff) | |
download | gcc-f62054146e86e792b6ce061bd418b9a2384ae9a5.zip gcc-f62054146e86e792b6ce061bd418b9a2384ae9a5.tar.gz gcc-f62054146e86e792b6ce061bd418b9a2384ae9a5.tar.bz2 |
[multiple changes]
2012-02-08 Yannick Moy <moy@adacore.com>
* gnat_rm.texi: Minor reshuffling to place restriction at
appropriate place.
2012-02-08 Bob Duff <duff@adacore.com>
* warnsw.adb (Set_Warning_Switch): Set Warn_On_Suspicious_Modulus_Value
False for '-gnatwA', to suppress these warnings.
2012-02-08 Vincent Celier <celier@adacore.com>
* sinput-p.adb (Source_File_Is_Subunit): Check for BOM before
starting to scan, so that UTF8 encoding is taken into account.
2012-02-08 Arnaud Charlet <charlet@adacore.com>
* s-tasren.adb, s-tasren.ads (Internal_Complete_Rendezvous): New
function.
(Complete_Rendezvous): Now call Internal_Complete_Rendezvous.
(Exceptional_Complete_Rendezvous): Mark No_Return.
2012-02-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Compile_Time_Known_Composite_Value):
New predicate to compute whether a composite value can be
evaluated at compile time.
(Component_Not_OK_For_Backend): Use Compile_Time_Known_Value for all
expressions of elementary type and Compile_Time_Known_Composite_Value
for all other expressions.
(Expand_Record_Aggregate): Convert to assignments in the case
of a type with mutable components if the aggregate cannot be
built statically.
2012-02-08 Gary Dismukes <dismukes@adacore.com>
* aspects.ads (type Aspect_Id): Add Simple_Storage_Pool_Type.
(Impl_Defined_Aspects): Add association for
Aspect_Simple_Storage_Pool_Type.
(Aspect_Names): Add
association for Aspect_Simple_Storage_Pool_Type.
* aspects.adb:
(Canonical_Aspect): Add association for Simple_Storage_Pool_Type.
* exp_attr.adb (Expand_N_Attribute_Reference):
Change name to Name_Simple_Storage_Pool_Type.
* exp_ch4.adb (Expand_N_Allocator): Change
name to Name_Simple_Storage_Pool_Type.
* exp_intr.adb (Expand_Unc_Deallocation): Change name to
Name_Simple_Storage_Pool_Type. * freeze.adb (Freeze_Entity):
Change names to Name_Simple_Storage_Pool_Type. * par-prag.adb:
Change names to Name_Simple_Storage_Pool_Type. * sem_attr.adb:
(Analyze_Attribute): Change name to Name_Simple_Storage_Pool_Type.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause):
Change name to Name_Simple_Storage_Pool_Type.
* sem_prag.adb:
(Analyze_Pragma): Change name to Name_Simple_Storage_Pool_Type.
(Sig_Flags): Change name to Name_Simple_Storage_Pool_Type.
* sem_res.adb (Resolve_Allocator): Change name to
Name_Simple_Storage_Pool_Type. * snames.ads-tmpl:
(Name_Simple_Storage_Pool_Type): New name constant.
(type Pragma_Id): Change name to Name_Simple_Storage_Pool_Type and
move to main pragma section because it no longer matches the
attribute name.
* snames.adb-tmpl (Get_Pragma_Id): Remove test for
Name_Simple_Storage_Pool.
(Is_Pragma_Name): Remove test for Name_Simple_Storage_Pool.
2012-02-08 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Add some clarification to -gnatwA and -gnatws.
From-SVN: r184003
Diffstat (limited to 'gcc/ada/sinput-p.adb')
-rw-r--r-- | gcc/ada/sinput-p.adb | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/gcc/ada/sinput-p.adb b/gcc/ada/sinput-p.adb index 156f036..f8ea812 100644 --- a/gcc/ada/sinput-p.adb +++ b/gcc/ada/sinput-p.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- -- @@ -26,10 +26,15 @@ with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; +with GNAT.Byte_Order_Mark; use GNAT.Byte_Order_Mark; + +with Opt; use Opt; +with Output; use Output; with Prj.Err; with Sinput.C; with System; +with System.WCh_Con; use System.WCh_Con; package body Sinput.P is @@ -164,6 +169,46 @@ package body Sinput.P is Prj.Err.Scanner.Set_Special_Character ('#'); Prj.Err.Scanner.Set_Special_Character ('$'); + -- Check for BOM + + declare + BOM : BOM_Kind; + Len : Natural; + Tst : String (1 .. 5); + + begin + for J in 1 .. 5 loop + Tst (J) := Source (Scan_Ptr + Source_Ptr (J) - 1); + end loop; + + Read_BOM (Tst, Len, BOM, False); + + case BOM is + when UTF8_All => + Scan_Ptr := Scan_Ptr + Source_Ptr (Len); + Wide_Character_Encoding_Method := WCEM_UTF8; + Upper_Half_Encoding := True; + + when UTF16_LE | UTF16_BE => + Set_Standard_Error; + Write_Line ("UTF-16 encoding format not recognized"); + Set_Standard_Output; + raise Unrecoverable_Error; + + when UTF32_LE | UTF32_BE => + Set_Standard_Error; + Write_Line ("UTF-32 encoding format not recognized"); + Set_Standard_Output; + raise Unrecoverable_Error; + + when Unknown => + null; + + when others => + raise Program_Error; + end case; + end; + -- We scan past junk to the first interesting compilation unit token, to -- see if it is SEPARATE. We ignore WITH keywords during this and also -- PRIVATE. The reason for ignoring PRIVATE is that it handles some |