diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-23 09:53:24 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-23 09:53:24 +0000 |
commit | 5779992c5ea21eb32a3c7942e76fc79763436013 (patch) | |
tree | 682a591ce203dec73771dbec80125a9be4066201 /gcc/ada/switch-c.adb | |
parent | 375329af2b53362b28a81f065697d0599b8934cc (diff) | |
download | gcc-5779992c5ea21eb32a3c7942e76fc79763436013.tar.gz |
2010-06-23 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch11.adb (Expand_Local_Exception_Handlers): Propagate the end
label to the new sequence of statements. Set the sloc of the raise
statement onto the new goto statements.
2010-06-23 Robert Dewar <dewar@adacore.com>
* a-stuten.ads, a-stuten.adb: New files.
* impunit.adb: Add engtry for Ada.Strings.UTF_Encoding (a-stuten.ads)
* Makefile.rtl: Add entry for a-stuten (Ada.Strings.UTF_Encoding)
2010-06-23 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Add documentation of -gnat12 switch
Add documentation of -gnatX switch.
2010-06-23 Ed Schonberg <schonberg@adacore.com>
* inline.ads: Include the current Ada_Version in the info for pending
instance bodies, so that declaration and body are compiled with the
same Ada_Version.
* inline.adb: Move with_clause for Opt to spec.
* sem_ch12.adb (Analyze_Package_Instantiation,
Analyze_Subprogram_Instantiation): Save current Ada_Version in
Pending_Instantiation information.
(Instantiate_Package_Body, Instantiate_Subprogram_Body,
Inline_Package_Body): Use the Ada_Version present in the body
information.
2010-06-23 Robert Dewar <dewar@adacore.com>
* usage.adb: Add documentation for -gnat12 switch.
* errout.ads: Add VMS alias entry for -gnat12 switch
* gnat_rm.texi: Add documentation for pragma Ada_12 and Ada_2012
Add documentation for pragma Extensions_Allowed.
* opt.ads: Add entry for Ada 2012 mode.
* sem_ch4.adb, par-ch3.adb, par-ch4.adb: Use new Ada 2012 mode for 2012
features.
* sem_prag.adb, par-prag.adb: Add processing for pragma Ada_12 and
Ada_2012.
* sem_ch13.adb: Add handling for Ada 2012 mode.
* snames.ads-tmpl: Add entries for pragma Ada_2012 and Ada_12.
* switch-c.adb: Add handling for -gnat12 switch.
Implement -gnat2005 and -gnat2012.
* usage.adb: Add documentation for -gnat12 switch.
* vms_data.ads: Add /12 switch for Ada 2012 mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161268 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/switch-c.adb')
-rw-r--r-- | gcc/ada/switch-c.adb | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index ccc9986bf4b..ab213af14bb 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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- -- @@ -532,11 +532,11 @@ package body Switch.C is System_Extend_Unit := Empty; Warning_Mode := Treat_As_Error; - -- Set Ada 2005 mode explicitly. We don't want to rely on the + -- Set Ada 2012 mode explicitly. We don't want to rely on the -- implicit setting here, since for example, we want -- Preelaborate_05 treated as Preelaborate - Ada_Version := Ada_05; + Ada_Version := Ada_12; Ada_Version_Explicit := Ada_Version; -- Set default warnings and style checks for -gnatg @@ -903,6 +903,8 @@ package body Switch.C is when 'X' => Ptr := Ptr + 1; Extensions_Allowed := True; + Ada_Version := Ada_Version_Type'Last; + Ada_Version_Explicit := Ada_Version_Type'Last; -- Processing for y switch @@ -1048,6 +1050,42 @@ package body Switch.C is Ada_Version_Explicit := Ada_Version; end if; + -- Processing for 12 switch + + when '1' => + if Ptr = Max then + Bad_Switch ("-gnat1"); + end if; + + Ptr := Ptr + 1; + + if Switch_Chars (Ptr) /= '2' then + Bad_Switch ("-gnat1" & Switch_Chars (Ptr .. Max)); + else + Ptr := Ptr + 1; + Ada_Version := Ada_12; + Ada_Version_Explicit := Ada_Version; + end if; + + -- Processing for 2005 and 2012 switches + + when '2' => + if Ptr > Max - 3 then + Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Max)); + + elsif Switch_Chars (Ptr .. Ptr + 3) = "2005" then + Ada_Version := Ada_05; + + elsif Switch_Chars (Ptr .. Ptr + 3) = "2012" then + Ada_Version := Ada_12; + + else + Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Ptr + 3)); + end if; + + Ada_Version_Explicit := Ada_Version; + Ptr := Ptr + 4; + -- Switch cancellation, currently only -gnat-p is allowed. -- All we do here is the error checking, since the actual -- processing for switch cancellation is done by calls to |