summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_elim.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 09:37:30 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 09:37:30 +0000
commit9429b6e934d31424545c97da2568452a83ef85f3 (patch)
tree067b6fb3d3db09d6874a82087fceda2ef195ae17 /gcc/ada/sem_elim.adb
parentce3dae590ae3e05156168a1cfab2b98a2286e848 (diff)
downloadgcc-9429b6e934d31424545c97da2568452a83ef85f3.tar.gz
2009-04-20 Gary Dismukes <dismukes@adacore.com>
* sem_elim.ads (Check_For_Eliminated_Subprogram): New procedure for checking for references to eliminated subprograms that should be flagged. (Eliminate_Error_Message): Update comment to say "references" rather than "calls" (since attribute cases are handled here as well). * sem_elim.adb (Check_For_Eliminated_Subprogram): New procedure for checking for references to eliminated subprograms that should be flagged. Add with and use of Sem and Sem_Util. * sem_res.adb (Resolve_Call): Reject calls to eliminated subprograms. Add with and use of Sem_Elim. * sem_attr.adb (Analyze_Access_Attribute): Reject access attributes applied to eliminated subprograms. (Analyze_Attribute): Reject 'Address and 'Code_Address applied to eliminated subprograms. Add with and use of Sem_Elim. * sem_disp.adb (Check_Dispatching_Call): Remove error check for calls to eliminated subprograms, now handled during Resolve_Call. Remove with and use of Sem_Elim. * exp_disp.adb (Make_DT): Get Ultimate_Alias of primitive before testing Is_Eliminated, for proper handling of primitive derived from eliminated subprograms. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146385 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_elim.adb')
-rw-r--r--gcc/ada/sem_elim.adb26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/sem_elim.adb b/gcc/ada/sem_elim.adb
index 6dd7021e7cf..ddcb32b8fc5 100644
--- a/gcc/ada/sem_elim.adb
+++ b/gcc/ada/sem_elim.adb
@@ -28,7 +28,9 @@ with Einfo; use Einfo;
with Errout; use Errout;
with Namet; use Namet;
with Nlists; use Nlists;
+with Sem; use Sem;
with Sem_Prag; use Sem_Prag;
+with Sem_Util; use Sem_Util;
with Sinput; use Sinput;
with Sinfo; use Sinfo;
with Snames; use Snames;
@@ -662,6 +664,30 @@ package body Sem_Elim is
return;
end Check_Eliminated;
+ -------------------------------------
+ -- Check_For_Eliminated_Subprogram --
+ -------------------------------------
+
+ procedure Check_For_Eliminated_Subprogram (N : Node_Id; S : Entity_Id) is
+ Ultimate_Subp : constant Entity_Id := Ultimate_Alias (S);
+ Enclosing_Subp : Entity_Id;
+
+ begin
+ if Is_Eliminated (Ultimate_Subp) and then not Inside_A_Generic then
+
+ Enclosing_Subp := Current_Subprogram;
+ while Present (Enclosing_Subp) loop
+ if Is_Eliminated (Enclosing_Subp) then
+ return;
+ end if;
+
+ Enclosing_Subp := Enclosing_Subprogram (Enclosing_Subp);
+ end loop;
+
+ Eliminate_Error_Msg (N, Ultimate_Subp);
+ end if;
+ end Check_For_Eliminated_Subprogram;
+
-------------------------
-- Eliminate_Error_Msg --
-------------------------