[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 13:33:32 +0000 (15:33 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 13:33:32 +0000 (15:33 +0200)
2011-08-29  Yannick Moy  <moy@adacore.com>

* exp_ch13.adb: Adjust previous change.

2011-08-29  Robert Dewar  <dewar@adacore.com>

* sem_prag.adb, prj.adb, sem_util.adb, sem_res.adb, gnat1drv.adb,
exp_ch4.adb, sem_ch8.adb: Minor code reorganization
Minor reformatting.

From-SVN: r178226

gcc/ada/ChangeLog
gcc/ada/exp_ch13.adb
gcc/ada/exp_ch4.adb
gcc/ada/gnat1drv.adb
gcc/ada/prj.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb

index f96c6c882dc2225221493012c8935052ebd981a0..6d02bc6dd38758c38f917269a3d90c6d33f0ca97 100644 (file)
@@ -1,3 +1,13 @@
+2011-08-29  Yannick Moy  <moy@adacore.com>
+
+       * exp_ch13.adb: Adjust previous change.
+
+2011-08-29  Robert Dewar  <dewar@adacore.com>
+
+       * sem_prag.adb, prj.adb, sem_util.adb, sem_res.adb, gnat1drv.adb,
+       exp_ch4.adb, sem_ch8.adb: Minor code reorganization
+       Minor reformatting.
+
 2011-08-29  Emmanuel Briot  <briot@adacore.com>
 
        * make.adb, prj.adb, prj.ads (Compute_All_Imported_Projects): Also
index 068ba582bb33e69dbf0f934dcd59a88678b891ba..a6890d72746313516902c340dfc7f1512a41c747 100644 (file)
@@ -307,13 +307,6 @@ package body Exp_Ch13 is
       Delete         : Boolean := False;
 
    begin
-      --  In formal verification mode, do not generate useless and confusing
-      --  expansion for freeze nodes.
-
-      if ALFA_Mode then
-         return;
-      end if;
-
       --  If there are delayed aspect specifications, we insert them just
       --  before the freeze node. They are already analyzed so we don't need
       --  to reanalyze them (they were analyzed before the type was frozen),
index 55ea87a79be3ba932639e5e38c22867d5c13cd22..8ac78ac1f5e0da031ee858ee6460313fa9d74f53 100644 (file)
@@ -7593,6 +7593,9 @@ package body Exp_Ch4 is
       Test         : Node_Id;
 
    begin
+      --  Do not expand quantified expressions in ALFA mode
+      --  why not???
+
       if ALFA_Mode then
          return;
       end if;
index 6c1292e7b7030fbfb1ad155e8ed2d5b7242965ea..daab3d0be30710183eb8cc166a645269c37cc24d 100644 (file)
@@ -351,7 +351,7 @@ procedure Gnat1drv is
       if Debug_Flag_Dot_XX then
          Use_Expression_With_Actions := True;
 
-      --  Debug flag -gnatd.Y decisively set usage off
+      --  Debug flag -gnatd.Y decisively sets usage off
 
       elsif Debug_Flag_Dot_YY then
          Use_Expression_With_Actions := False;
@@ -445,6 +445,7 @@ procedure Gnat1drv is
          Debug_Flag_HH := True;
 
          --  Disable Expressions_With_Actions nodes
+
          --  The gnat2why backend does not deal with Expressions_With_Actions
          --  in all places (in particular assertions). It is difficult to
          --  determine in the frontend which cases are allowed, so we disable
index 63fb12759deb0184c870764c3f69315cbe200e01..626b8eee0d75a1417bd761df5bd7b7bd1482e74f 100644 (file)
@@ -1288,7 +1288,8 @@ package body Prj is
       Tree         : Project_Tree_Ref)
    is
       procedure Analyze_Tree
-        (Local_Root : Project_Id; Local_Tree : Project_Tree_Ref);
+        (Local_Root : Project_Id;
+         Local_Tree : Project_Tree_Ref);
       --  Process Project and all its aggregated project to analyze their own
       --  imported projects.
 
@@ -1297,7 +1298,8 @@ package body Prj is
       ------------------
 
       procedure Analyze_Tree
-        (Local_Root : Project_Id; Local_Tree : Project_Tree_Ref)
+        (Local_Root : Project_Id;
+         Local_Tree : Project_Tree_Ref)
       is
          pragma Unreferenced (Local_Root);
 
@@ -1320,8 +1322,8 @@ package body Prj is
             Dummy : in out Boolean)
          is
             pragma Unreferenced (Dummy, Tree);
-            List    : Project_List;
-            Prj2    : Project_Id;
+            List : Project_List;
+            Prj2 : Project_Id;
 
          begin
             --  A project is not importing itself
@@ -1357,6 +1359,7 @@ package body Prj is
 
          Dummy   : Boolean := False;
          List    : Project_List;
+
       begin
          List := Local_Tree.Projects;
          while List /= null loop
@@ -1372,6 +1375,8 @@ package body Prj is
       procedure For_Aggregates is
         new For_Project_And_Aggregated (Analyze_Tree);
 
+   --  Start of processing for Compute_All_Imported_Projects
+
    begin
       For_Aggregates (Root_Project, Tree);
    end Compute_All_Imported_Projects;
index deb25af66060c5ced92bf20661307d6b6d72bd4d..46bdf73ab0d05620a8639725202c4b1440c52201 100644 (file)
@@ -5542,7 +5542,6 @@ package body Sem_Ch8 is
                                 Scope_Depth (Old_S)
                               then
                                  return Old_S;
-
                               else
                                  return It.Nam;
                               end if;
@@ -5555,7 +5554,7 @@ package body Sem_Ch8 is
                            return Report_Overload;
                         end if;
 
-                     --  If not within an instance, ambiguity is real.
+                     --  If not within an instance, ambiguity is real
 
                      else
                         return Report_Overload;
index 081d9aeffef2b403655d309f1ee693c2ce711297..c16a671e0d36bd15844246a8c38f9653c56843b5 100644 (file)
@@ -13326,6 +13326,7 @@ package body Sem_Prag is
             if Arg_Count = 4 then
                Check_Identifier (Arg3, Name_Requires);
                Check_Identifier (Arg4, Name_Ensures);
+
             elsif Arg_Count = 3 then
                Check_Identifier_Is_One_Of (Arg3, Name_Requires, Name_Ensures);
             end if;
index ab57f46f7e8f13919af54394e55b7852de2db646..f56b849cbed654bb8b6aec13cb53b500c7717b73 100644 (file)
@@ -8076,6 +8076,8 @@ package body Sem_Res is
 
    procedure Resolve_Quantified_Expression (N : Node_Id; Typ : Entity_Id) is
    begin
+      --  Normal mode (not ALFA)
+
       if not ALFA_Mode then
 
          --  The loop structure is already resolved during its analysis, only
@@ -8086,11 +8088,10 @@ package body Sem_Res is
          Expander_Mode_Save_And_Set (False);
          Resolve (Condition (N), Typ);
          Expander_Mode_Restore;
-      else
 
-         --  In ALFA_Mode, no such magic needs to happen, we just resolve the
-         --  underlying nodes.
+      --  In ALFA_Mode, no magic needed, we just resolve the underlying nodes
 
+      else
          Resolve (Condition (N), Typ);
       end if;
    end Resolve_Quantified_Expression;
index 86c57267b65dcf165e09677b7a20386dbca5d377..814eaa4e9659e72a746a042086c85c1b345cf815 100644 (file)
@@ -4274,7 +4274,7 @@ package body Sem_Util is
 
    function Get_Ensures_From_Test_Case_Pragma (N : Node_Id) return Node_Id is
       Args : constant List_Id := Pragma_Argument_Associations (N);
-      Res  : Node_Id := Empty;
+      Res  : Node_Id;
 
    begin
       if List_Length (Args) = 4 then
@@ -4282,9 +4282,13 @@ package body Sem_Util is
 
       elsif List_Length (Args) = 3 then
          Res := Pick (Args, 3);
+
          if Chars (Res) /= Name_Ensures then
             Res := Empty;
          end if;
+
+      else
+         Res := Empty;
       end if;
 
       return Res;
@@ -4436,14 +4440,18 @@ package body Sem_Util is
 
    function Get_Requires_From_Test_Case_Pragma (N : Node_Id) return Node_Id is
       Args : constant List_Id := Pragma_Argument_Associations (N);
-      Res  : Node_Id := Empty;
+      Res  : Node_Id;
 
    begin
       if List_Length (Args) >= 3 then
          Res := Pick (Args, 3);
+
          if Chars (Res) /= Name_Requires then
             Res := Empty;
          end if;
+
+      else
+         Res := Empty;
       end if;
 
       return Res;