[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 24 Jan 2014 15:02:48 +0000 (16:02 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 24 Jan 2014 15:02:48 +0000 (16:02 +0100)
2014-01-24  Robert Dewar  <dewar@adacore.com>

* sinfo.ads, make.adb, prj-env.adb: Minor reformatting.

2014-01-24  Vincent Celier  <celier@adacore.com>

* prj.adb (Add_Aggregated_Project): Do not add a project in
the list if it is already there.

2014-01-24  Yannick Moy  <moy@adacore.com>

* lib-xref-spark_specific.adb (Enclosing_Subprogram_Or_Package):
Correct the search for a subrogram declaration to which a pragma is
attached.

2014-01-24  Bob Duff  <duff@adacore.com>

* gnat_ugn.texi: Document --decimal-grouping and
--based-grouping switches in gnatpp.

From-SVN: r207042

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/lib-xref-spark_specific.adb
gcc/ada/make.adb
gcc/ada/prj-env.adb
gcc/ada/prj.adb
gcc/ada/sinfo.ads

index 59072a6e5633fa50ccbfe5d2af44729d4a404534..576d30643bb6afa39af86533c067b7650b97a77f 100644 (file)
@@ -1,3 +1,23 @@
+2014-01-24  Robert Dewar  <dewar@adacore.com>
+
+       * sinfo.ads, make.adb, prj-env.adb: Minor reformatting.
+
+2014-01-24  Vincent Celier  <celier@adacore.com>
+
+       * prj.adb (Add_Aggregated_Project): Do not add a project in
+       the list if it is already there.
+
+2014-01-24  Yannick Moy  <moy@adacore.com>
+
+       * lib-xref-spark_specific.adb (Enclosing_Subprogram_Or_Package):
+       Correct the search for a subrogram declaration to which a pragma is
+       attached.
+
+2014-01-24  Bob Duff  <duff@adacore.com>
+
+       * gnat_ugn.texi: Document --decimal-grouping and
+       --based-grouping switches in gnatpp.
+
 2014-01-24  Ed Schonberg  <schonberg@adacore.com>
 
        * sinfo.ads: Documentation update.
index 11286ef0766cbb0e43ce572de76a00f019b27cba..ca3eacc86ce9f03067c0cd12f2029487073077cc 100644 (file)
@@ -14324,9 +14324,23 @@ line indentation is also 1)
 
 @noindent
 These switches control the inclusion of missing end/exit labels, and
-the indentation level in @b{case} statements.
+the indentation level in @b{case} statements, etc.
 
 @table @option
+@item --decimal-grouping=@var{n}
+@cindex @option{--decimal-grouping} @command{gnatpp}
+Put underscores in decimal literals (numeric literals without a base)
+every @var{n} characters. If a literal already has one or more
+underscores, it is not modified. For example, with
+@code{--decimal-grouping=3}, @code{1000000} will be changed to
+@code{1_000_000}.
+
+@item --based-grouping=@var{n}
+@cindex @option{--based-grouping} @command{gnatpp}
+Same as @code{--decimal-grouping}, but for based literals. For
+example, with @code{--based-grouping=4}, @code{16#0001FFFE#} will be
+changed to @code{16#0001_FFFE#}.
+
 @item ^-e^/NO_MISSED_LABELS^
 @cindex @option{^-e^/NO_MISSED_LABELS^} (@command{gnatpp})
 Do not insert missing end/exit labels. An end label is the name of
index 849ff0e2dbf715556084b50b5ec27ce287644d30..9328be84b5de4ca08997f5a2e40ca25cdfd4818c 100644 (file)
@@ -1023,25 +1023,18 @@ package body SPARK_Specific is
             when N_Pragma =>
 
                --  The enclosing subprogram for a precondition, postcondition,
-               --  or contract case should be the subprogram to which the
-               --  pragma is attached, which can be found by following
-               --  previous elements in the list to which the pragma belongs.
-
-               if Get_Pragma_Id (Result) = Pragma_Precondition
-                    or else
-                  Get_Pragma_Id (Result) = Pragma_Postcondition
-                    or else
-                  Get_Pragma_Id (Result) = Pragma_Contract_Cases
-               then
-                  if Is_List_Member (Result)
-                    and then Present (Prev (Result))
-                  then
-                     Result := Prev (Result);
-                  else
-                     Result := Parent (Result);
-                  end if;
-
-               else
+               --  or contract case should be the declaration preceding the
+               --  pragma (skipping any other pragmas between this pragma and
+               --  this declaration.
+
+               while Nkind (Result) = N_Pragma
+                 and then Is_List_Member (Result)
+                 and then Present (Prev (Result))
+               loop
+                  Result := Prev (Result);
+               end loop;
+
+               if Nkind (Result) = N_Pragma then
                   Result := Parent (Result);
                end if;
 
index 84b7a3b64e07ac7ce25357e05f56c01c97c26f66..c8c605313e10498af1069bd70fa60c156c0d8214 100644 (file)
@@ -4556,14 +4556,13 @@ package body Make is
 
       if Main_Project /= No_Project then
 
-         --  Put all the source directories in ADA_INCLUDE_PATH,
-         --  and all the object directories in ADA_OBJECTS_PATH,
-         --  except those of library projects.
+         --  Put all the source directories in ADA_INCLUDE_PATH, and all the
+         --  object directories in ADA_OBJECTS_PATH.
 
          Prj.Env.Set_Ada_Paths
            (Project             => Main_Project,
             In_Tree             => Project_Tree,
-            Including_Libraries => False,
+            Including_Libraries => True,
             Include_Path        => Use_Include_Path_File);
 
          --  If switch -C was specified, create a binder mapping file
index b3a5d7993c66c7e29a7d2cd14b4dc4ead90021c7..b50481e0d2fe98b4987af7da26cb091d26bb1f8c 100644 (file)
@@ -147,8 +147,8 @@ package body Prj.Env is
    begin
       if Recursive then
 
-         --  If it is the first time we call this function for
-         --  this project, compute the source path
+         --  If it is the first time we call this function for this project,
+         --  compute the source path
 
          if Project.Ada_Include_Path = null then
             Buffer := new String (1 .. Buffer_Initial);
index e3a4c49dcacc74a740a8d4804e541ea4e2ca972b..d7e2bc74a6bd05712c0f6f0dd070995b1cc09650 100644 (file)
@@ -1083,8 +1083,24 @@ package body Prj is
    ----------------------------
 
    procedure Add_Aggregated_Project
-     (Project : Project_Id; Path : Path_Name_Type) is
+     (Project : Project_Id;
+      Path    : Path_Name_Type)
+   is
+      Aggregated : Aggregated_Project_List;
+
    begin
+      --  Check if the project is already in the aggregated project list. If it
+      --  is, do not add it again.
+
+      Aggregated := Project.Aggregated_Projects;
+      while Aggregated /= null loop
+         if Path = Aggregated.Path then
+            return;
+         else
+            Aggregated := Aggregated.Next;
+         end if;
+      end loop;
+
       Project.Aggregated_Projects := new Aggregated_Project'
         (Path    => Path,
          Project => No_Project,
index f71fdd0a0ae60e5f8dc7a73353f6c2d5b4ca0800..61c7da4c7c46887626ec74b79a75150c205cbc7f 100644 (file)
@@ -517,7 +517,7 @@ package Sinfo is
    --  form that meets additional requirements.
 
    --  This light expansion does two transformations of the tree that cannot
-   --  be postponed after semantic analysis:
+   --  be postponed till after semantic analysis:
 
    --    1. Replace object renamings by renamed object. This requires the
    --       introduction of temporaries at the point of the renaming, which
@@ -555,15 +555,15 @@ package Sinfo is
 
    --  The following flag fields appear in expression nodes:
 
-   --  Do_Division_Check
-   --  Do_Overflow_Check
-   --  Do_Range_Check
+   --    Do_Division_Check
+   --    Do_Overflow_Check
+   --    Do_Range_Check
 
    --  These three flags are always set by the front end during semantic
    --  analysis, on expression nodes that may trigger the corresponding
-   --  check. The front end then inserts or not the check during expansion.
-   --  In particular, these flags should also be correctly set in ASIS mode
-   --  and GNATprove mode.
+   --  check. The front end then inserts or not the check during expansion. In
+   --  particular, these flags should also be correctly set in ASIS mode and
+   --  GNATprove mode.
 
    --  Note that this accounts for all nodes that trigger the corresponding
    --  checks, except for range checks on subtype_indications, which may be
@@ -572,11 +572,11 @@ package Sinfo is
 
    --  The following flag fields appear in various nodes:
 
-   --  Do_Accessibility_Check
-   --  Do_Discriminant_Check
-   --  Do_Length_Check
-   --  Do_Storage_Check
-   --  Do_Tag_Check
+   --    Do_Accessibility_Check
+   --    Do_Discriminant_Check
+   --    Do_Length_Check
+   --    Do_Storage_Check
+   --    Do_Tag_Check
 
    --  These flags are used in some specific cases by the front end, either
    --  during semantic analysis or during expansion, and cannot be expected