OSDN Git Service

* doc/install.texi (Specific, mips-sgi-irix5): Document IRIX 5
[pf3gnuchains/gcc-fork.git] / gcc / ada / validsw.adb
index 923c913..1c7d5cf 100644 (file)
@@ -6,23 +6,20 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                            $Revision: 1.2 $
---                                                                          --
---             Copyright (C) 2001 Free Software Foundation, Inc.            --
+--          Copyright (C) 2001-2007, 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 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,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license.          --
 --                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc.      --
 --                                                                          --
 ------------------------------------------------------------------------------
 
@@ -36,6 +33,7 @@ package body Validsw is
 
    procedure Reset_Validity_Check_Options is
    begin
+      Validity_Check_Components     := False;
       Validity_Check_Copies         := False;
       Validity_Check_Default        := True;
       Validity_Check_Floating_Point := False;
@@ -74,8 +72,10 @@ package body Validsw is
          Options (K) := ' ';
       end loop;
 
+      Add ('n', not Validity_Check_Default);
+
       Add ('c', Validity_Check_Copies);
-      Add ('d', Validity_Check_Default);
+      Add ('e', Validity_Check_Components);
       Add ('f', Validity_Check_Floating_Point);
       Add ('i', Validity_Check_In_Params);
       Add ('m', Validity_Check_In_Out_Params);
@@ -104,7 +104,8 @@ package body Validsw is
    procedure Set_Validity_Check_Options (Options : String) is
       OK : Boolean;
       EC : Natural;
-
+      pragma Warnings (Off, OK);
+      pragma Warnings (Off, EC);
    begin
       Set_Validity_Check_Options (Options, OK, EC);
    end Set_Validity_Check_Options;
@@ -120,20 +121,26 @@ package body Validsw is
       C : Character;
 
    begin
-      Reset_Validity_Check_Options;
-
       J := Options'First;
       while J <= Options'Last loop
          C := Options (J);
          J := J + 1;
 
+         --  Turn on validity checking (gets turned off by Vn)
+
+         Validity_Checks_On := True;
+
          case C is
+
             when 'c' =>
                Validity_Check_Copies         := True;
 
             when 'd' =>
                Validity_Check_Default        := True;
 
+            when 'e' =>
+               Validity_Check_Components     := True;
+
             when 'f' =>
                Validity_Check_Floating_Point := True;
 
@@ -146,6 +153,9 @@ package body Validsw is
             when 'o' =>
                Validity_Check_Operands       := True;
 
+            when 'p' =>
+               Validity_Check_Parameters     := True;
+
             when 'r' =>
                Validity_Check_Returns        := True;
 
@@ -161,6 +171,9 @@ package body Validsw is
             when 'D' =>
                Validity_Check_Default        := False;
 
+            when 'E' =>
+               Validity_Check_Components     := False;
+
             when 'I' =>
                Validity_Check_In_Params      := False;
 
@@ -173,6 +186,9 @@ package body Validsw is
             when 'O' =>
                Validity_Check_Operands       := False;
 
+            when 'P' =>
+               Validity_Check_Parameters     := False;
+
             when 'R' =>
                Validity_Check_Returns        := False;
 
@@ -183,26 +199,31 @@ package body Validsw is
                Validity_Check_Tests          := False;
 
             when 'a' =>
+               Validity_Check_Components     := True;
                Validity_Check_Copies         := True;
                Validity_Check_Default        := True;
                Validity_Check_Floating_Point := True;
                Validity_Check_In_Out_Params  := True;
                Validity_Check_In_Params      := True;
                Validity_Check_Operands       := True;
+               Validity_Check_Parameters     := True;
                Validity_Check_Returns        := True;
                Validity_Check_Subscripts     := True;
                Validity_Check_Tests          := True;
 
             when 'n' =>
+               Validity_Check_Components     := False;
                Validity_Check_Copies         := False;
                Validity_Check_Default        := False;
                Validity_Check_Floating_Point := False;
                Validity_Check_In_Out_Params  := False;
                Validity_Check_In_Params      := False;
                Validity_Check_Operands       := False;
+               Validity_Check_Parameters     := False;
                Validity_Check_Returns        := False;
                Validity_Check_Subscripts     := False;
                Validity_Check_Tests          := False;
+               Validity_Checks_On            := False;
 
             when ' ' =>
                null;
@@ -214,7 +235,6 @@ package body Validsw is
          end case;
       end loop;
 
-      Validity_Checks_On := True;
       OK := True;
       Err_Col := Options'Last + 1;
    end Set_Validity_Check_Options;