[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 6 Aug 2012 07:51:56 +0000 (09:51 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 6 Aug 2012 07:51:56 +0000 (09:51 +0200)
2012-08-06  Robert Dewar  <dewar@adacore.com>

* aspects.ads: Define Aspect_Id_Exclude_No_Aspect.
* par-ch13.adb, restrict.adb: Use Aspect_Id_Exclude_No_Aspect to
simplify code.

2012-08-06  Yannick Moy  <moy@adacore.com>

* gnat-style.texi: Update style guide for declarations.

2012-08-06  Yannick Moy  <moy@adacore.com>

* sem_attr.adb (Analyze_Attribute): In the case for 'Old,
skip a special expansion which is not needed in Alfa mode.

2012-08-06  Yannick Moy  <moy@adacore.com>

* sem_ch5.adb (Analyze_Iterator_Specification): Do not perform
an expansion of the iterator in Alfa mode.

From-SVN: r190159

gcc/ada/ChangeLog
gcc/ada/aspects.ads
gcc/ada/gnat-style.texi
gcc/ada/par-ch13.adb
gcc/ada/restrict.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch5.adb

index 8f7c9ca2316585c71cde0cf829cb74af7e8dc65c..7c4419396443441197aaa1b85f05b5f459630f83 100644 (file)
@@ -1,3 +1,23 @@
+2012-08-06  Robert Dewar  <dewar@adacore.com>
+
+       * aspects.ads: Define Aspect_Id_Exclude_No_Aspect.
+       * par-ch13.adb, restrict.adb: Use Aspect_Id_Exclude_No_Aspect to
+       simplify code.
+
+2012-08-06  Yannick Moy  <moy@adacore.com>
+
+       * gnat-style.texi: Update style guide for declarations.
+
+2012-08-06  Yannick Moy  <moy@adacore.com>
+
+       * sem_attr.adb (Analyze_Attribute): In the case for 'Old,
+       skip a special expansion which is not needed in Alfa mode.
+
+2012-08-06  Yannick Moy  <moy@adacore.com>
+
+       * sem_ch5.adb (Analyze_Iterator_Specification): Do not perform
+       an expansion of the iterator in Alfa mode.
+
 2012-08-06  Robert Dewar  <dewar@adacore.com>
 
        * s-oscons-tmplt.c, sem_ch9.adb, osint.adb: Minor reformatting.
index b21b1e239730f21380c2a13100ef8a663cda4f84..ebe71aec0c35f4b1487cea8c2e24d4e4269c9da6 100644 (file)
@@ -184,6 +184,10 @@ package Aspects is
 
       Aspect_Lock_Free);
 
+   subtype Aspect_Id_Exclude_No_Aspect is
+     Aspect_Id range Aspect_Id'Succ (No_Aspect) .. Aspect_Id'Last;
+   --  Aspect_Id's excluding No_Aspect
+
    --  The following array indicates aspects that accept 'Class
 
    Class_Aspect_OK : constant array (Aspect_Id) of Boolean :=
index 1bba70309359f501d1cad65e6a64e233dd02030d..63882afcecab3d3cde84da1d2e9d529e734ed398 100644 (file)
@@ -7,14 +7,14 @@
 @c                                                                            o
 @c                     G N A T   C O D I N G   S T Y L E                      o
 @c                                                                            o
-@c   GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com).   o
+@c                     Copyright (C) 1992-2012, AdaCore                       o
 @c                                                                            o
 @c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
 
 @setfilename gnat-style.info
 
 @copying
-Copyright @copyright{} 1992-2008, Free Software Foundation, Inc.
+Copyright @copyright{} 1992-2012, AdaCore
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -350,6 +350,24 @@ that give useful information instead.
 Local names can be shorter, because they are used only within
 one context, where comments explain their purpose.
 
+@item
+When starting a default expression on the line that follows the declaration
+line, use 2 characters for indentation.
+
+@smallexample @c adanocomment
+        Entity1 : Integer :=
+          Function_Name (Parameters, For_Call);
+@end smallexample
+
+@item
+If a default expression needs to be continued on subsequent lines, the
+continuations should be indented from the start of the expression.
+
+@smallexample @c adanocomment
+        Entity1   : Integer := Long_Function_Name
+                                 (parameters for call);
+@end smallexample
+
 @end itemize
 
 
index f6927edc68fbacbfe37f7aa4babb09bdd14fdb67..72ca041e3c09fd6afe1f46c03aea020e674f48b6 100644 (file)
@@ -187,10 +187,8 @@ package body Ch13 is
 
             --  Check bad spelling
 
-            for J in Aspect_Id loop
-               if J /= No_Aspect and then
-                  Is_Bad_Spelling_Of (Token_Name, Aspect_Names (J))
-               then
+            for J in Aspect_Id_Exclude_No_Aspect loop
+               if Is_Bad_Spelling_Of (Token_Name, Aspect_Names (J)) then
                   Error_Msg_Name_1 := Aspect_Names (J);
                   Error_Msg_SC -- CODEFIX
                     ("\possible misspelling of%");
index 6b3dc2a0c4c4646623f2326b1c8faf2bb56f4244..14ab452b47790451a84412204e1e31d8afcc01b5 100644 (file)
@@ -1259,8 +1259,7 @@ package body Restrict is
      (N       : Node_Id;
       Warning : Boolean)
    is
-      A_Id : constant Aspect_Id := Get_Aspect_Id (Chars (N));
-      pragma Assert (A_Id /= No_Aspect);
+      A_Id : constant Aspect_Id_Exclude_No_Aspect := Get_Aspect_Id (Chars (N));
 
    begin
       No_Specification_Of_Aspects (A_Id) := Sloc (N);
index 782cd984fde8ccd2b69064fdbccf18e81e7f9c4a..35adaaf6a613d04c25f17d200b117ce622f135d5 100644 (file)
@@ -4034,7 +4034,13 @@ package body Sem_Attr is
          --  enclosing subprogram. This is properly an expansion activity
          --  but it has to be performed now to prevent out-of-order issues.
 
-         if not Is_Entity_Name (P) then
+         --  This expansion is both harmful and not needed in Alfa mode, since
+         --  the formal verification backend relies on the types of nodes
+         --  (hence is not robust w.r.t. a change to base type here), and does
+         --  not suffer from the out-of-order issue described above. Thus, this
+         --  expansion is skipped in Alfa mode.
+
+         if not Is_Entity_Name (P) and then not Alfa_Mode then
             P_Type := Base_Type (P_Type);
             Set_Etype (N, P_Type);
             Set_Etype (P, P_Type);
index d2e9d9169d4e8af214c48366ad893ec2ef5d6858..f3df8c5c6ab9bdf57722fb528a03540425e533df 100644 (file)
@@ -1665,16 +1665,21 @@ package body Sem_Ch5 is
       --  If the domain of iteration is an expression, create a declaration for
       --  it, so that finalization actions are introduced outside of the loop.
       --  The declaration must be a renaming because the body of the loop may
-      --  assign to elements. When the context is a quantified expression, the
-      --  renaming declaration is delayed until the expansion phase.
+      --  assign to elements.
 
       if not Is_Entity_Name (Iter_Name)
+
+        --  When the context is a quantified expression, the renaming
+        --  declaration is delayed until the expansion phase if we are
+        --  doing expansion.
+
         and then (Nkind (Parent (N)) /= N_Quantified_Expression
+                   or else Operating_Mode = Check_Semantics)
 
-                   --  The following two tests need comments ???
+        --  Do not perform this expansion in Alfa mode, since the formal
+        --  verification directly deals with the source form of the iterator.
 
-                   or else Operating_Mode = Check_Semantics
-                   or else Alfa_Mode)
+        and then not Alfa_Mode
       then
          declare
             Id   : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name);
@@ -1711,7 +1716,7 @@ package body Sem_Ch5 is
       --  Container is an entity or an array with uncontrolled components, or
       --  else it is a container iterator given by a function call, typically
       --  called Iterate in the case of predefined containers, even though
-      --  Iterate is not a reserved name. What matter is that the return type
+      --  Iterate is not a reserved name. What matters is that the return type
       --  of the function is an iterator type.
 
       elsif Is_Entity_Name (Iter_Name) then