[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 23 Apr 2013 09:47:13 +0000 (11:47 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 23 Apr 2013 09:47:13 +0000 (11:47 +0200)
2013-04-23  Robert Dewar  <dewar@adacore.com>

* sem_util.adb, sem_res.adb, prj-tree.adb, prj-tree.ads: Minor
reformatting.

2013-04-23  Pascal Obry  <obry@adacore.com>

* xoscons.adb: Remove unused use clause, minor code clean-up.

From-SVN: r198182

gcc/ada/ChangeLog
gcc/ada/prj-tree.adb
gcc/ada/prj-tree.ads
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb
gcc/ada/xoscons.adb

index 3ff802fd64e64f0eb8e9aded263bf80bcf264cff..3c09dd07efb78e777578e9419e1fbac29cb5d434 100644 (file)
@@ -1,3 +1,12 @@
+2013-04-23  Robert Dewar  <dewar@adacore.com>
+
+       * sem_util.adb, sem_res.adb, prj-tree.adb, prj-tree.ads: Minor
+       reformatting.
+
+2013-04-23  Pascal Obry  <obry@adacore.com>
+
+       * xoscons.adb: Remove unused use clause, minor code clean-up.
+
 2013-04-23  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_util.ads, sem_util.adb: Code cleanup for Is_Expression_Function
index 8072c9daae4e46451811d77a682016719010c576..c1215216dbb0f9b6ae58a3039e54e945f72ec52e 100644 (file)
@@ -2,11 +2,11 @@
 --                                                                          --
 --                         GNAT COMPILER COMPONENTS                         --
 --                                                                          --
---                              P R J . T R E E                             --
+--                             P R J . T R E E                              --
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2013, 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- --
@@ -279,7 +279,8 @@ package body Prj.Tree is
 
    function Case_Insensitive
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Boolean is
+      In_Tree : Project_Node_Tree_Ref) return Boolean
+   is
    begin
       pragma Assert
         (Present (Node)
@@ -524,7 +525,8 @@ package body Prj.Tree is
 
    function Directory_Of
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Path_Name_Type is
+      In_Tree : Project_Node_Tree_Ref) return Path_Name_Type
+   is
    begin
       pragma Assert
         (Present (Node)
@@ -539,7 +541,8 @@ package body Prj.Tree is
 
    function End_Of_Line_Comment
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Name_Id is
+      In_Tree : Project_Node_Tree_Ref) return Name_Id
+   is
       Zone : Project_Node_Id := Empty_Node;
 
    begin
@@ -960,7 +963,8 @@ package body Prj.Tree is
 
    function Follows_Empty_Line
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Boolean is
+      In_Tree : Project_Node_Tree_Ref) return Boolean
+   is
    begin
       pragma Assert
         (Present (Node)
@@ -1005,14 +1009,14 @@ package body Prj.Tree is
    ----------------
 
    procedure Initialize
-     (Self      : out Environment;
-      Flags     : Processing_Flags) is
+     (Self  : out Environment;
+      Flags : Processing_Flags)
+   is
    begin
       --  Do not reset the external references, in case we are reloading a
       --  project, since we want to preserve the current environment. But we
       --  still need to ensure that the external references are properly
       --  initialized.
-      --  Prj.Ext.Reset (Tree.External);
 
       Prj.Ext.Initialize (Self.External);
 
@@ -1025,7 +1029,8 @@ package body Prj.Tree is
 
    procedure Initialize_And_Copy
      (Self      : out Environment;
-      Copy_From : Environment) is
+      Copy_From : Environment)
+   is
    begin
       Self.Flags := Copy_From.Flags;
       Prj.Ext.Initialize (Self.External, Copy_From => Copy_From.External);
@@ -1079,7 +1084,8 @@ package body Prj.Tree is
 
    function Is_Extending_All
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Boolean is
+      In_Tree : Project_Node_Tree_Ref) return Boolean
+   is
    begin
       pragma Assert
         (Present (Node)
@@ -1096,7 +1102,8 @@ package body Prj.Tree is
 
    function Is_Not_Last_In_List
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Boolean is
+      In_Tree : Project_Node_Tree_Ref) return Boolean
+   is
    begin
       pragma Assert
         (Present (Node)
@@ -1155,7 +1162,8 @@ package body Prj.Tree is
 
    function Kind_Of
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Project_Node_Kind is
+      In_Tree : Project_Node_Tree_Ref) return Project_Node_Kind
+   is
    begin
       pragma Assert (Present (Node));
       return In_Tree.Project_Nodes.Table (Node).Kind;
@@ -1167,7 +1175,8 @@ package body Prj.Tree is
 
    function Location_Of
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Source_Ptr is
+      In_Tree : Project_Node_Tree_Ref) return Source_Ptr
+   is
    begin
       pragma Assert (Present (Node));
       return In_Tree.Project_Nodes.Table (Node).Location;
@@ -1179,7 +1188,8 @@ package body Prj.Tree is
 
    function Name_Of
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Name_Id is
+      In_Tree : Project_Node_Tree_Ref) return Name_Id
+   is
    begin
       pragma Assert (Present (Node));
       return In_Tree.Project_Nodes.Table (Node).Name;
@@ -1207,7 +1217,8 @@ package body Prj.Tree is
 
    function Next_Comment
      (Node    : Project_Node_Id;
-      In_Tree : Project_Node_Tree_Ref) return Project_Node_Id is
+      In_Tree : Project_Node_Tree_Ref) return Project_Node_Id
+   is
    begin
       pragma Assert
         (Present (Node)
@@ -1648,8 +1659,8 @@ package body Prj.Tree is
                      Follows_Empty_Line        => Empty_Line,
                      Is_Followed_By_Empty_Line => False);
 
-               --  Otherwise, it is an end of line comment. If there is
-               --  an end of line node specified, associate the comment with
+               --  Otherwise, it is an end of line comment. If there is an
+               --  end of line node specified, associate the comment with
                --  this node.
 
                elsif Present (End_Of_Line_Node) then
@@ -2038,7 +2049,6 @@ package body Prj.Tree is
      (Node    : Project_Node_Id;
       In_Tree : Project_Node_Tree_Ref;
       To      : Project_Node_Id)
-
    is
       Zone : constant Project_Node_Id := Comment_Zones_Of (Node, In_Tree);
    begin
index a16409965d00a76ab64bf25dbf5646a31374a581..0d585a3afe48f6a584156f86d4d30a22d6ddb907 100644 (file)
@@ -2,11 +2,11 @@
 --                                                                          --
 --                         GNAT COMPILER COMPONENTS                         --
 --                                                                          --
---                              P R J . T R E E                             --
+--                             P R J . T R E E                              --
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2001-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2013, 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- --
@@ -61,8 +61,8 @@ package Prj.Tree is
    end record;
 
    procedure Initialize
-     (Self      : out Environment;
-      Flags     : Processing_Flags);
+     (Self  : out Environment;
+      Flags : Processing_Flags);
    --  Initialize a new environment
 
    procedure Initialize_And_Copy
index 7d00399f52d28b0a3783bbbb7fd95a23cc4d4e5a..db6ecf7ecfb82d8dd7a23a7c3930bc612743a565 100644 (file)
@@ -5376,19 +5376,19 @@ package body Sem_Res is
 
       Check_Internal_Protected_Use (N, Nam);
 
-      --  Freeze the subprogram name if not in a spec-expression. Note that we
-      --  freeze procedure calls as well as function calls. Procedure calls are
-      --  not frozen according to the rules (RM 13.14(14)) because it is
-      --  impossible to have a procedure call to a non-frozen procedure in pure
-      --  Ada, but in the code that we generate in the expander, this rule
-      --  needs extending because we can generate procedure calls that need
-      --  freezing.
+      --  Freeze the subprogram name if not in a spec-expression. Note that
+      --  we freeze procedure calls as well as function calls. Procedure calls
+      --  are not frozen according to the rules (RM 13.14(14)) because it is
+      --  impossible to have a procedure call to a non-frozen procedure in
+      --  pure Ada, but in the code that we generate in the expander, this
+      --  rule needs extending because we can generate procedure calls that
+      --  need freezing.
 
       --  In Ada 2012, expression functions may be called within pre/post
       --  conditions of subsequent functions or expression functions. Such
       --  calls do not freeze when they appear within generated bodies,
       --  (including the body of another expression function) which would
-      --  place the freeze node in the wrong scope.  An expression function
+      --  place the freeze node in the wrong scope. An expression function
       --  is frozen in the usual fashion, by the appearance of a real body,
       --  or at the end of a declarative part.
 
index 172721d65190d6694e27264a3599b305a1810975..199c55121b8addbae246a64c495155c75cb23959 100644 (file)
@@ -8137,8 +8137,9 @@ package body Sem_Util is
                  (Present (Corresponding_Body (Decl))
                    and then
                      Nkind (Original_Node
-                        (Unit_Declaration_Node (Corresponding_Body (Decl))))
-                    = N_Expression_Function));
+                             (Unit_Declaration_Node
+                               (Corresponding_Body (Decl)))) =
+                                  N_Expression_Function));
       end if;
    end Is_Expression_Function;
 
index 74b76c9455bf6e387fccf23413a5afe3d451e55e..2aafe08769ac1dba5d45401b1e6cf5268cf26021 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2008-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 2008-2013, 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- --
@@ -55,7 +55,6 @@ with XUtil; use XUtil;
 procedure XOSCons is
 
    use Ada.Strings;
-   use ASCII;
 
    Unit_Name : constant String := Argument (1);
    Tmpl_Name : constant String := Unit_Name & "-tmplt";
@@ -442,6 +441,7 @@ procedure XOSCons is
       Ada_Ofile, C_Ofile : Sfile;
       Current_Line       : in out Integer)
    is
+
       function Get_Value (Name : String) return Int_Value_Type;
       --  Returns the value of the variable Name
 
@@ -516,7 +516,7 @@ procedure XOSCons is
          Current_Line := Current_Line + 1;
          exit when Line (1 .. Last) = "@END_IF";
 
-         if Line (1 .. 4) = "@IF " then
+         if Last > 4 and then Line (1 .. 4) = "@IF " then
             Parse_Cond
               (Line (1 .. Last), Res,
                Tmpl_File, Ada_Ofile, C_Ofile, Current_Line);