]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 13 Jun 2014 10:08:18 +0000 (12:08 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 13 Jun 2014 10:08:18 +0000 (12:08 +0200)
2014-06-13  Emmanuel Briot  <briot@adacore.com>

* g-comlin.adb (Get_Argument): fix expansion
of command line arguments (e.g. "*.adb") when using a custom
parser. The parser was not passed to the recursive call, and
thus we were trying to do the expansion on the default command
line parser.

2014-06-13  Thomas Quinot  <quinot@adacore.com>

* exp_ch9.adb: Minor reformatting.

2014-06-13  Ed Schonberg  <schonberg@adacore.com>

* exp_attr.adb (Expand_N_Attribute_Reference, case 'Old):
To determine whether the attribute should be expanded, examine
whether the enclosing postcondition pragma is to be checked,
rather than using the internal flag Assertions_Enabled.

From-SVN: r211621

gcc/ada/ChangeLog
gcc/ada/exp_attr.adb
gcc/ada/exp_ch9.adb
gcc/ada/g-comlin.adb

index 6f4785f59624b5ec651b55b94ecda2c29e88212b..0e241e9c360668d277daa4ef00a88989d92acc31 100644 (file)
@@ -1,3 +1,22 @@
+2014-06-13  Emmanuel Briot  <briot@adacore.com>
+
+       * g-comlin.adb (Get_Argument): fix expansion
+       of command line arguments (e.g. "*.adb") when using a custom
+       parser. The parser was not passed to the recursive call, and
+       thus we were trying to do the expansion on the default command
+       line parser.
+
+2014-06-13  Thomas Quinot  <quinot@adacore.com>
+
+       * exp_ch9.adb: Minor reformatting.
+
+2014-06-13  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_attr.adb (Expand_N_Attribute_Reference, case 'Old):
+       To determine whether the attribute should be expanded, examine
+       whether the enclosing postcondition pragma is to be checked,
+       rather than using the internal flag Assertions_Enabled.
+
 2014-06-13  Ben Brosgol  <brosgol@adacore.com>
 
        * gnat_rm.texi: Minor fixes.
index 4b4ede7b820c5a1f62a98f48114561a20ba6fadf..b16e95d96e8aa8fda75664a52517baa1e4cb2831 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2013, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2014, 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- --
@@ -3962,13 +3962,6 @@ package body Exp_Attr is
          Temp    : Entity_Id;
 
       begin
-         --  If assertions are disabled, no need to create the declaration
-         --  that preserves the value.
-
-         if not Assertions_Enabled then
-            return;
-         end if;
-
          Temp := Make_Temporary (Loc, 'T', Pref);
 
          --  Climb the parent chain looking for subprogram _Postconditions
@@ -3978,6 +3971,17 @@ package body Exp_Attr is
             exit when Nkind (Subp) = N_Subprogram_Body
               and then Chars (Defining_Entity (Subp)) = Name_uPostconditions;
 
+            --  If assertions are disabled, no need to create the declaration
+            --  that preserves the value. The postcondition pragma in which
+            --  'Old appears will be checked or disabled according to the
+            --  current policy in effect.
+
+            if Nkind (Subp) = N_Pragma
+              and then not Is_Checked (Subp)
+            then
+               return;
+            end if;
+
             Subp := Parent (Subp);
          end loop;
 
index a1ff4de309d631fcd9df28ada6392db4481b3339..f5c6f575ee1969c99f128a9bd56f3c3518d94771 100644 (file)
@@ -1206,11 +1206,10 @@ package body Exp_Ch9 is
       end if;
 
       Master_Id :=
-        Make_Defining_Identifier (Loc,
-          New_External_Name (Chars (Typ), 'M'));
+        Make_Defining_Identifier (Loc, New_External_Name (Chars (Typ), 'M'));
 
       --  Generate:
-      --    Mnn renames _master;
+      --    typeMnn renames _master;
 
       Ren_Decl :=
         Make_Object_Renaming_Declaration (Loc,
index 0f74bbfdc6027c7b8dd3e8ce611ee6c490500bef..4a7c85bd382fe30de2186a71327475b0813cfc49 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1999-2013, Free Software Foundation, Inc.         --
+--          Copyright (C) 1999-2014, 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- --
@@ -402,7 +402,6 @@ package body GNAT.Command_Line is
       end if;
 
       if Parser.Current_Argument > Parser.Arg_Count then
-
          --  If this is the first time this function is called
 
          if Parser.Current_Index = 1 then
@@ -449,21 +448,16 @@ package body GNAT.Command_Line is
          declare
             Arg   : constant String :=
                       Argument (Parser, Parser.Current_Argument - 1);
-            Index : Positive;
-
          begin
-            Index := Arg'First;
-            while Index <= Arg'Last loop
+            for Index in Arg'Range loop
                if Arg (Index) = '*'
                  or else Arg (Index) = '?'
                  or else Arg (Index) = '['
                then
                   Parser.In_Expansion := True;
                   Start_Expansion (Parser.Expansion_It, Arg);
-                  return Get_Argument (Do_Expansion);
+                  return Get_Argument (Do_Expansion, Parser);
                end if;
-
-               Index := Index + 1;
             end loop;
          end;
       end if;