From: Arnaud Charlet Date: Fri, 18 Jun 2010 13:54:07 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b3f937f00f4d14bb1606407b3af663645863446;p=gcc.git [multiple changes] 2010-06-18 Ed Schonberg * sem_elim.adb: Proper error message on improperly eliminated instances 2010-06-18 Vincent Celier * prj.ads (Response_File_Format): New value GCC. 2010-06-18 Thomas Quinot * gnat1drv.adb: Minor reformatting. From-SVN: r160992 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7c6fa2dbe89..e0334226b00 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2010-06-18 Ed Schonberg + + * sem_elim.adb: Proper error message on improperly eliminated instances + +2010-06-18 Vincent Celier + + * prj.ads (Response_File_Format): New value GCC. + +2010-06-18 Thomas Quinot + + * gnat1drv.adb: Minor reformatting. + 2010-06-18 Robert Dewar * make.adb, sem_cat.adb: Minor reformatting. diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 2c95dd64961..85d9dcc950b 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -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; diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index d10c65f9a3a..434145027e2 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -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 diff --git a/gcc/ada/sem_elim.adb b/gcc/ada/sem_elim.adb index 9917b1f3511..97faf84877f 100644 --- a/gcc/ada/sem_elim.adb +++ b/gcc/ada/sem_elim.adb @@ -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;