In Alfa mode, formal verification backend takes care of checks, hence there is
no need for the frontend to insert checks.

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-11-21  Yannick Moy  <m...@adacore.com>

        * checks.adb (Apply_Access_Check, Apply_Arithmetic_Overflow_Check,
        Apply_Discriminant_Check, Apply_Divide_Check,
        Apply_Selected_Length_Checks, Apply_Selected_Range_Checks,
        Build_Discriminant_Checks, Insert_Range_Checks, Selected_Length_Checks,
        Selected_Range_Checks): Replace reference to Expander_Active
        with reference to Full_Expander_Active, so that expansion of
        checks is not performed in Alfa mode

Index: checks.adb
===================================================================
--- checks.adb  (revision 181556)
+++ checks.adb  (working copy)
@@ -442,7 +442,7 @@
       --  are cases (e.g. with pragma Debug) where generating the checks
       --  can cause real trouble).
 
-      if not Expander_Active then
+      if not Full_Expander_Active then
          return;
       end if;
 
@@ -878,7 +878,7 @@
 
          if Backend_Overflow_Checks_On_Target
            or else not Do_Overflow_Check (N)
-           or else not Expander_Active
+           or else not Full_Expander_Active
            or else (Present (Parent (N))
                      and then Nkind (Parent (N)) = N_Type_Conversion
                      and then Integer_Promotion_Possible (Parent (N)))
@@ -1178,7 +1178,7 @@
       --  Nothing to do if discriminant checks are suppressed or else no code
       --  is to be generated
 
-      if not Expander_Active
+      if not Full_Expander_Active
         or else Discriminant_Checks_Suppressed (T_Typ)
       then
          return;
@@ -1462,7 +1462,7 @@
       --  Don't actually use this value
 
    begin
-      if Expander_Active
+      if Full_Expander_Active
         and then not Backend_Divide_Checks_On_Target
         and then Check_Needed (Right, Division_Check)
       then
@@ -2118,7 +2118,7 @@
                       (not Length_Checks_Suppressed (Target_Typ));
 
    begin
-      if not Expander_Active then
+      if not Full_Expander_Active then
          return;
       end if;
 
@@ -2226,7 +2226,7 @@
                     (not Range_Checks_Suppressed (Target_Typ));
 
    begin
-      if not Expander_Active or else not Checks_On then
+      if not Full_Expander_Active or else not Checks_On then
          return;
       end if;
 
@@ -5309,7 +5309,7 @@
       --  enhanced to check for an always True value in the condition and to
       --  generate a compilation warning???
 
-      if not Expander_Active or else not Checks_On then
+      if not Full_Expander_Active or else not Checks_On then
          return;
       end if;
 
@@ -6236,7 +6236,7 @@
    --  Start of processing for Selected_Length_Checks
 
    begin
-      if not Expander_Active then
+      if not Full_Expander_Active then
          return Ret_Result;
       end if;
 
@@ -6810,7 +6810,7 @@
    --  Start of processing for Selected_Range_Checks
 
    begin
-      if not Expander_Active then
+      if not Full_Expander_Active then
          return Ret_Result;
       end if;
 

Reply via email to