[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 18 Jun 2010 13:54:07 +0000 (15:54 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 18 Jun 2010 13:54:07 +0000 (15:54 +0200)
2010-06-18  Ed Schonberg  <schonberg@adacore.com>

* sem_elim.adb: Proper error message on improperly eliminated instances

2010-06-18  Vincent Celier  <celier@adacore.com>

* prj.ads (Response_File_Format): New value GCC.

2010-06-18  Thomas Quinot  <quinot@adacore.com>

* gnat1drv.adb: Minor reformatting.

From-SVN: r160992

gcc/ada/ChangeLog
gcc/ada/gnat1drv.adb
gcc/ada/prj.ads
gcc/ada/sem_elim.adb

index 7c6fa2dbe8970aa1296c0daf6591680959868aa5..e0334226b000af5ccc6769a69fbdcf2b8ebb545b 100644 (file)
@@ -1,3 +1,15 @@
+2010-06-18  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_elim.adb: Proper error message on improperly eliminated instances
+
+2010-06-18  Vincent Celier  <celier@adacore.com>
+
+       * prj.ads (Response_File_Format): New value GCC.
+
+2010-06-18  Thomas Quinot  <quinot@adacore.com>
+
+       * gnat1drv.adb: Minor reformatting.
+
 2010-06-18  Robert Dewar  <dewar@adacore.com>
 
        * make.adb, sem_cat.adb: Minor reformatting.
index 2c95dd649613009ed4a52ee992e3654a5fe66a82..85d9dcc950bcece52da94815bc1ad76d1ec4f26d 100644 (file)
@@ -353,8 +353,8 @@ procedure Gnat1drv is
       then
          Use_Expression_With_Actions := False;
 
-         --  Otherwise normal gcc back end, which does implement this feature
-         --  so by default we allow its use.
+      --  Otherwise normal gcc back end, which does implement this feature so
+      --  by default we allow its use.
 
       else
          Use_Expression_With_Actions := True;
index d10c65f9a3ad1a0ce95b6f3610aa5c641935f081..434145027e26f185b2cc288e5178f8fb47e1113d 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2001-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2010, 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- --
@@ -894,6 +894,7 @@ package Prj is
    type Response_File_Format is
      (None,
       GNU,
+      GCC,
       Object_List,
       Option_List);
    --  The format of the different response files
index 9917b1f35118915d55cc361ffeb1a528f750ec56..97faf84877ffb53c36345f5604aeaf4e79a3c79f 100644 (file)
@@ -344,10 +344,9 @@ package body Sem_Elim is
             if Present (Elmt.Entity_Node)
               and then Elmt.Entity_Scope /= null
             then
-
-               --  Check that names of enclosing scopes match.
-               --  Skip blocks and wrapper package of subprogram instances,
-               --  which do not appear in the pragma.
+               --  Check that names of enclosing scopes match. Skip blocks and
+               --  wrapper package of subprogram instances, which do not appear
+               --  in the pragma.
 
                Scop := Scope (E);
 
@@ -723,14 +722,19 @@ package body Sem_Elim is
             Enclosing_Subp := Enclosing_Subprogram (Enclosing_Subp);
          end loop;
 
-         --  Emit error, unless we are within an instance body and
-         --  the expander is disabled, which indicates an instance
-         --  within an enclosing generic.
+         --  Emit error, unless we are within an instance body and the expander
+         --  is disabled, indicating an instance within an enclosing generic.
+         --  In an instance, the ultimate alias is an internal entity, so place
+         --  the message on the original subprogram.
 
          if In_Instance_Body and then not Expander_Active then
             null;
-         else
+
+         elsif Comes_From_Source (Ultimate_Subp) then
             Eliminate_Error_Msg (N, Ultimate_Subp);
+
+         else
+            Eliminate_Error_Msg (N, S);
          end if;
       end if;
    end Check_For_Eliminated_Subprogram;
@@ -762,7 +766,9 @@ package body Sem_Elim is
       --  Otherwise should not fall through, entry should be in table
 
       else
-         raise Program_Error;
+         Error_Msg_NE
+           ("subprogram& is called but its alias is eliminated", N, E);
+         --  raise Program_Error;
       end if;
    end Eliminate_Error_Msg;