]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 09:38:07 +0000 (10:38 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 09:38:07 +0000 (10:38 +0100)
2013-01-02  Thomas Quinot  <quinot@adacore.com>

* exp_prag.adb (Expand_Pragma_Check): The statements generated
for the pragma must have the sloc of the pragma, not the
sloc of the condition, otherwise this creates anomalies in the
generated debug information that confuse coverage analysis tools.

2013-01-02  Thomas Quinot  <quinot@adacore.com>

* sem_ch13.adb: Minor reformatting.

2013-01-02  Arnaud Charlet  <charlet@adacore.com>

* g-excact.ads (Core_Dump): Clarify that this subprogram does
not dump cores under Windows.

2013-01-02  Ed Schonberg  <schonberg@adacore.com>

* sem_ch8.adb (Analyze_Primitive_Renamed_Operation): The prefixed
view of a subprogram has convention Intrnnsic, and a renaming
of a prefixed view cannot be the prefix of an Access attribute.

2013-01-02  Robert Dewar  <dewar@adacore.com>

* restrict.adb: Minor reformatting.

From-SVN: r194782

gcc/ada/ChangeLog
gcc/ada/exp_prag.adb
gcc/ada/g-excact.ads
gcc/ada/restrict.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch8.adb

index 7d79a90658ad5885cac9021108240c5efd0faa0c..e92b0d765a68acf58eb180be5394099212eb2762 100644 (file)
@@ -1,3 +1,29 @@
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * exp_prag.adb (Expand_Pragma_Check): The statements generated
+       for the pragma must have the sloc of the pragma, not the
+       sloc of the condition, otherwise this creates anomalies in the
+       generated debug information that confuse coverage analysis tools.
+
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * sem_ch13.adb: Minor reformatting.
+
+2013-01-02  Arnaud Charlet  <charlet@adacore.com>
+
+       * g-excact.ads (Core_Dump): Clarify that this subprogram does
+       not dump cores under Windows.
+
+2013-01-02  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch8.adb (Analyze_Primitive_Renamed_Operation): The prefixed
+       view of a subprogram has convention Intrnnsic, and a renaming
+       of a prefixed view cannot be the prefix of an Access attribute.
+
+2013-01-02  Robert Dewar  <dewar@adacore.com>
+
+       * restrict.adb: Minor reformatting.
+
 2013-01-02  Thomas Quinot  <quinot@adacore.com>
 
        * exp_prag.adb: Minor reformatting.
index 9ff1318345cf726dfae40ef934dc31414e35e316..f607b37faa3b1bc72c5a78a24a02398ccb41b450 100644 (file)
@@ -274,18 +274,18 @@ package body Exp_Prag is
    --------------------------
 
    procedure Expand_Pragma_Check (N : Node_Id) is
+      Loc  : constant Source_Ptr := Sloc (N);
+      --  Location of the pragma node. Note: it is important to use this
+      --  location (and not the location of the expression) for the generated
+      --  statements, otherwise the implicit return statement in the body
+      --  of a pre/postcondition subprogram may inherit the source location
+      --  of part of the expression, which causes confusing debug information
+      --  to be generated, which interferes with coverage analysis tools.
+
       Cond : constant Node_Id := Arg2 (N);
       Nam  : constant Name_Id := Chars (Arg1 (N));
       Msg  : Node_Id;
 
-      Loc  : constant Source_Ptr := Sloc (First_Node (Cond));
-      --  Source location used in the case of a failed assertion. Note that
-      --  the source location of the expression is not usually the best choice
-      --  here. For example, it gets located on the last AND keyword in a
-      --  chain of boolean expressiond AND'ed together. It is best to put the
-      --  message on the first character of the assertion, which is the effect
-      --  of the First_Node call here.
-
    begin
       --  We already know that this check is enabled, because otherwise the
       --  semantic pass dealt with rewriting the assertion (see Sem_Prag)
@@ -362,7 +362,15 @@ package body Exp_Prag is
 
          else
             declare
-               Msg_Loc : constant String := Build_Location_String (Loc);
+               Msg_Loc : constant String :=
+                           Build_Location_String (Sloc (First_Node (Cond)));
+               --  Source location used in the case of a failed assertion:
+               --  point to the failing condition, not Loc. Note that the
+               --  source location of the expression is not usually the best
+               --  choice here. For example, it gets located on the last AND
+               --  keyword in a chain of boolean expressiond AND'ed together.
+               --  It is best to put the message on the first character of the
+               --  condition, which is the effect of the First_Node call here.
 
             begin
                Name_Len := 0;
index 77abadac8fbdd7dd44e5f24471ae04362f1777f9..6111bc7fd0212175bf6f06125c98bd3667ebc55a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2002-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 2002-2012, 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- --
@@ -110,7 +110,9 @@ package GNAT.Exception_Actions is
    --  is compiled with pragma Restrictions (No_Exception_Registration);
 
    procedure Core_Dump (Occurrence : Exception_Occurrence);
-   --  Dump memory (called a core dump in some systems), and abort execution
-   --  of the application.
+   --  Dump memory (called a core dump in some systems) if supported by the
+   --  OS (most unix systems and VMS), and abort execution of the application.
+   --  Under Windows this procedure will not dump the memory, it will only
+   --  abort execution.
 
 end GNAT.Exception_Actions;
index 14ab452b47790451a84412204e1e31d8afcc01b5..84e576be92db5b1d3cffdf62ba96c25cfb503311 100644 (file)
@@ -611,8 +611,8 @@ package body Restrict is
       end if;
 
       --  Ignore call if node N is not in the main source unit, since we only
-      --  give messages for . This avoids giving messages for aspects that are
-      --  specified in withed units.
+      --  give messages for the main unit. This avoids giving messages for
+      --  aspects that are specified in withed units.
 
       if not In_Extended_Main_Source_Unit (N) then
          return;
index a959e51a86272ccc2b71fb168b43f015cb99a488..235af1893849a9b72cf39b9fb95236718d59cd95 100644 (file)
@@ -1886,7 +1886,7 @@ package body Sem_Ch13 is
 
             --  In the context of a compilation unit, we directly put the
             --  pragma in the Pragmas_After list of the
-            --  N_Compilation_Unit_Aux node (No delay is required here)
+            --  N_Compilation_Unit_Aux node (no delay is required here)
             --  except for aspects on a subprogram body (see below).
 
             if Nkind (Parent (N)) = N_Compilation_Unit
@@ -2012,8 +2012,8 @@ package body Sem_Ch13 is
 
       Rewrite (N,
         Make_Attribute_Definition_Clause (Sloc (N),
-          Name  => Identifier (N),
-          Chars => Name_Address,
+          Name       => Identifier (N),
+          Chars      => Name_Address,
           Expression => Expression (N)));
 
       --  We preserve Comes_From_Source, since logically the clause still comes
index ae12e46681137b7071391c3c2292dbe9178f640a..5564dccdcee69be6aa9ca670f78e0911e3ec90ce 100644 (file)
@@ -397,8 +397,10 @@ package body Sem_Ch8 is
       New_S   : Entity_Id;
       Is_Body : Boolean);
    --  If the renamed entity in a subprogram renaming is a primitive operation
-   --  or a class-wide operation in prefix form, save the target object, which
-   --  must be added to the list of actuals in any subsequent call.
+   --  or a class-wide operation in prefix form, save the target object,
+   --  which must be added to the list of actuals in any subsequent call.
+   --  The renaming operation is intrinsic because the compiler must in
+   --  fact generate a wrapper for it (6.3.1 (10 1/2)).
 
    function Applicable_Use (Pack_Name : Node_Id) return Boolean;
    --  Common code to Use_One_Package and Set_Use, to determine whether use
@@ -1602,6 +1604,10 @@ package body Sem_Ch8 is
       --  match. The first formal of the renamed entity is skipped because it
       --  is the target object in any subsequent call.
 
+      --------------
+      -- Conforms --
+      --------------
+
       function Conforms
         (Subp : Entity_Id;
          Ctyp : Conformance_Type) return Boolean
@@ -1634,6 +1640,8 @@ package body Sem_Ch8 is
          return True;
       end Conforms;
 
+   --  Start of processing for Analyze_Renamed_Primitive_Operation
+
    begin
       if not Is_Overloaded (Selector_Name (Name (N))) then
          Old_S := Entity (Selector_Name (Name (N)));
@@ -1681,6 +1689,14 @@ package body Sem_Ch8 is
             if not Conforms (Old_S, Mode_Conformant) then
                Error_Msg_N ("mode conformance error in renaming", N);
             end if;
+
+            --  Enforce the rule given in (RM 6.3.1 (10.1/2)): a prefixed
+            --  view of a subprogram is intrinsic, because the compiler has
+            --  to generate a wrapper for any call to it. If the name in a
+            --  subprogram renaming is a prefixed view, the entity is thus
+            --  intrinsic, and 'Access cannot be applied to it.
+
+            Set_Convention (New_S, Convention_Intrinsic);
          end if;
 
          --  Inherit_Renamed_Profile (New_S, Old_S);