gcc/ada/ * checks.adb: Remove, not used. * checks.ads: Likewise. * exp_ch6.adb: Likewise. * exp_ch7.adb: Likewise. * exp_ch7.ads: Likewise. * exp_fixd.adb: Likewise. * exp_tss.adb: Likewise. * exp_tss.ads: Likewise. * exp_util.adb: Likewise. * exp_util.ads: Likewise. * gnat1drv.adb: Likewise. * libgnat/s-finmas.adb: Likewise. * libgnat/s-finmas.ads: Likewise. * libgnat/system-aix.ads: Likewise. * libgnat/system-darwin-arm.ads: Likewise. * libgnat/system-darwin-ppc.ads: Likewise. * libgnat/system-darwin-x86.ads: Likewise. * libgnat/system-djgpp.ads: Likewise. * libgnat/system-dragonfly-x86_64.ads: Likewise. * libgnat/system-freebsd.ads: Likewise. * libgnat/system-hpux-ia64.ads: Likewise. * libgnat/system-hpux.ads: Likewise. * libgnat/system-linux-alpha.ads: Likewise. * libgnat/system-linux-arm.ads: Likewise. * libgnat/system-linux-hppa.ads: Likewise. * libgnat/system-linux-ia64.ads: Likewise. * libgnat/system-linux-m68k.ads: Likewise. * libgnat/system-linux-mips.ads: Likewise. * libgnat/system-linux-ppc.ads: Likewise. * libgnat/system-linux-riscv.ads: Likewise. * libgnat/system-linux-s390.ads: Likewise. * libgnat/system-linux-sh4.ads: Likewise. * libgnat/system-linux-sparc.ads: Likewise. * libgnat/system-linux-x86.ads: Likewise. * libgnat/system-lynxos178-ppc.ads: Likewise. * libgnat/system-lynxos178-x86.ads: Likewise. * libgnat/system-mingw.ads: Likewise. * libgnat/system-qnx-aarch64.ads: Likewise. * libgnat/system-rtems.ads: Likewise. * libgnat/system-solaris-sparc.ads: Likewise. * libgnat/system-solaris-x86.ads: Likewise. * libgnat/system-vxworks-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks-arm-rtp.ads: Likewise. * libgnat/system-vxworks-arm.ads: Likewise. * libgnat/system-vxworks-e500-kernel.ads: Likewise. * libgnat/system-vxworks-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks-e500-rtp.ads: Likewise. * libgnat/system-vxworks-e500-vthread.ads: Likewise. * libgnat/system-vxworks-ppc-kernel.ads: Likewise. * libgnat/system-vxworks-ppc-ravenscar.ads: Likewise. * libgnat/system-vxworks-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks-ppc-rtp.ads: Likewise. * libgnat/system-vxworks-ppc-vthread.ads: Likewise. * libgnat/system-vxworks-ppc.ads: Likewise. * libgnat/system-vxworks-x86-kernel.ads: Likewise. * libgnat/system-vxworks-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks-x86-rtp.ads: Likewise. * libgnat/system-vxworks-x86-vthread.ads: Likewise. * libgnat/system-vxworks-x86.ads: Likewise. * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-aarch64.ads: Likewise. * libgnat/system-vxworks7-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-arm.ads: Likewise. * libgnat/system-vxworks7-e500-kernel.ads: Likewise. * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-e500-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc64-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-kernel.ads: Likewise. * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-rtp.ads: Likewise. * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise. * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise. * repinfo.adb: Likewise. * repinfo.ads: Likewise. * rtsfind.ads: Likewise. * sem_aux.adb: Likewise. * sem_aux.ads: Likewise. * sem_ch13.adb: Likewise. * sem_ch13.ads: Likewise. * sem_util.adb (Validity_Checks_Suppressed, TSS, Is_All_Null_Statements, Known_Non_Negative, Non_Limited_Designated_Type, Get_Binary_Nkind, Get_Unary_Nkind, Is_Protected_Operation, Number_Components, Package_Body, Validate_Independence, Independence_Checks): Likewise; update comments. * targparm.adb: Likewise. * targparm.ads (AAM, AAM_Str, Fractional_Fixed_Ops, Frontend_Layout, Make_Detach_Call, Target_Has_Fixed_Ops, Detach, Back_End_Layout, Create_Dynamic_SO_Ref, Get_Dynamic_SO_Entity, Is_Dynamic_SO_Ref, Is_Static_SO_Ref, Fractional_Fixed_Ops_On_Target): Likewise. * validsw.adb (Save_Validity_Check_Options, Set_Default_Validity_Check_Options): Likewise. * validsw.ads: Likewise.
154 lines
8.4 KiB
Ada
154 lines
8.4 KiB
Ada
------------------------------------------------------------------------------
|
|
-- --
|
|
-- GNAT COMPILER COMPONENTS --
|
|
-- --
|
|
-- V A L I D S W --
|
|
-- --
|
|
-- S p e c --
|
|
-- --
|
|
-- Copyright (C) 2001-2020, 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. 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 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. --
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
|
-- --
|
|
------------------------------------------------------------------------------
|
|
|
|
-- This unit contains the routines used to handle setting of validity
|
|
-- checking options.
|
|
|
|
package Validsw is
|
|
|
|
-----------------------------
|
|
-- Validity Check Switches --
|
|
-----------------------------
|
|
|
|
-- The following flags determine the specific set of validity checks
|
|
-- to be made if validity checking is active (Validity_Checks_On = True)
|
|
|
|
-- See GNAT users guide for an exact description of each option. The letter
|
|
-- given in the comment is the letter used in the -gnatV compiler switch
|
|
-- or in the argument of a Validity_Checks pragma to activate the option.
|
|
-- The corresponding upper case letter deactivates the option.
|
|
|
|
Validity_Check_Components : Boolean := False;
|
|
-- Controls validity checking for assignment to elementary components of
|
|
-- records. If this switch is set to True using -gnatVe, or an 'e' in the
|
|
-- argument of Validity_Checks pragma, then the right-hand side of an
|
|
-- assignment to such a component is checked for validity.
|
|
|
|
Validity_Check_Copies : Boolean := False;
|
|
-- Controls the validity checking of copies. If this switch is set to
|
|
-- True using -gnatVc, or a 'c' in the argument of a Validity_Checks
|
|
-- pragma, then the right-hand side of assignments and also initializing
|
|
-- expressions in object declarations are checked for validity.
|
|
|
|
Validity_Check_Default : Boolean := True;
|
|
-- Controls default (reference manual) validity checking. If this switch is
|
|
-- set to True using -gnatVd or a 'd' in the argument of a Validity_Checks
|
|
-- pragma (or the initial default value is used, set True), then left-hand
|
|
-- side subscripts and case statement arguments are checked for validity.
|
|
-- This switch is also set by default if no -gnatV switch is used and no
|
|
-- Validity_Checks pragma is processed.
|
|
|
|
Validity_Check_Floating_Point : Boolean := False;
|
|
-- Normally validity checking applies only to discrete values (integer and
|
|
-- enumeration types). If this switch is set to True using -gnatVf or an
|
|
-- 'f' in the argument of a Validity_Checks pragma, then floating-point
|
|
-- values are also checked. If the context in which such checks occur
|
|
-- depends on other flags, e.g. if Validity_Check_Copies is also set,
|
|
-- then floating-point values on the right-hand side of an assignment
|
|
-- will be validity checked.
|
|
|
|
Validity_Check_In_Out_Params : Boolean := False;
|
|
-- Controls the validity checking of IN OUT parameters. If this switch
|
|
-- is set to True using -gnatVm or a 'm' in the argument of a pragma
|
|
-- Validity_Checks, then the initial value of all IN OUT parameters
|
|
-- will be checked at the point of call of a procedure. Note that the
|
|
-- character 'm' here stands for modified (parameters).
|
|
|
|
Validity_Check_In_Params : Boolean := False;
|
|
-- Controls the validity checking of IN parameters. If this switch is
|
|
-- set to True using -gnatVi or an 'i' in the argument of a pragma
|
|
-- Validity_Checks, then the initial value of all IN parameters
|
|
-- will be checked at the point of call of a procedure or function.
|
|
|
|
Validity_Check_Operands : Boolean := False;
|
|
-- Controls validity checking of operands. If this switch is set to
|
|
-- True using -gnatVo or an 'o' in the argument of a Validity_Checks
|
|
-- pragma, then operands of all predefined operators and attributes
|
|
-- will be validity checked.
|
|
|
|
Validity_Check_Parameters : Boolean := False;
|
|
-- This controls validity treatment for parameters within a subprogram.
|
|
-- Normally if validity checking is enabled for parameters on a call
|
|
-- (Validity_Check_In[_Out]_Params) then an assumption is made that the
|
|
-- parameter values are valid on entry and not checked again within a
|
|
-- procedure. Setting Validity_Check_Parameters removes this assumption
|
|
-- and ensures that no assumptions are made about parameters, so that
|
|
-- they will always be checked.
|
|
|
|
Validity_Check_Returns : Boolean := False;
|
|
-- Controls validity checking of returned values. If this switch is set
|
|
-- to True using -gnatVr, or an 'r' in the argument of a Validity_Checks
|
|
-- pragma, then the expression in a RETURN statement is validity checked.
|
|
|
|
Validity_Check_Subscripts : Boolean := False;
|
|
-- Controls validity checking of subscripts. If this switch is set to True
|
|
-- using -gnatVs, or an 's' in the argument of a Validity_Checks pragma,
|
|
-- then all subscripts are checked for validity. Note that left-hand side
|
|
-- subscript checking is also controlled by Validity_Check_Default. If
|
|
-- Validity_Check_Subscripts is True, then all subscripts are checked,
|
|
-- otherwise if Validity_Check_Default is True, then left-hand side
|
|
-- subscripts are checked; otherwise no subscripts are checked.
|
|
|
|
Validity_Check_Tests : Boolean := False;
|
|
-- Controls validity checking of tests that occur in conditions (i.e. the
|
|
-- tests in IF, WHILE, and EXIT statements, and in entry guards). If this
|
|
-- switch is set to True using -gnatVt, or a 't' in the argument of a
|
|
-- Validity_Checks pragma, then all such conditions are validity checked.
|
|
|
|
Force_Validity_Checks : Boolean := False;
|
|
-- Normally, operands that do not come from source (i.e. cases of expander
|
|
-- generated code) are not checked, if this flag is set True, then checking
|
|
-- of such operands is forced (if Validity_Check_Operands is set).
|
|
|
|
-----------------
|
|
-- Subprograms --
|
|
-----------------
|
|
|
|
procedure Set_Validity_Check_Options
|
|
(Options : String;
|
|
OK : out Boolean;
|
|
Err_Col : out Natural);
|
|
-- This procedure is called to set the validity check options that
|
|
-- correspond to the characters in the given Options string. If
|
|
-- all options are valid, then Set_Default_Validity_Check_Options
|
|
-- is first called to set the defaults, and then the options in the
|
|
-- given string are set in an additive manner. If any invalid character
|
|
-- is found, then OK is False on exit, and Err_Col is the index in
|
|
-- in options of the bad character. If all options are valid, then
|
|
-- OK is True on return, and Err_Col is set to options'Last + 1.
|
|
|
|
procedure Set_Validity_Check_Options (Options : String);
|
|
-- Like the above procedure, except that the call is simply ignored if
|
|
-- there are any error conditions, this is for example appropriate for
|
|
-- calls where the string is known to be valid.
|
|
|
|
procedure Reset_Validity_Check_Options;
|
|
-- Sets all validity check options to off
|
|
|
|
subtype Validity_Check_Options is String (1 .. 16);
|
|
-- Long enough string to hold all options from Save call below
|
|
|
|
end Validsw;
|