aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_elim.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-02-23 12:17:13 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2004-02-23 12:17:13 +0100
commit6871ba5ffcd7c2eccc4acd66da2ab4f9bdb730fe (patch)
treeaa3ca3b1faa65ad0d368c42ec6ebdd8fe39f73b6 /gcc/ada/sem_elim.adb
parent615a5ba6b1c6f787b952541c5b727107f351aa43 (diff)
downloadgcc-6871ba5ffcd7c2eccc4acd66da2ab4f9bdb730fe.zip
gcc-6871ba5ffcd7c2eccc4acd66da2ab4f9bdb730fe.tar.gz
gcc-6871ba5ffcd7c2eccc4acd66da2ab4f9bdb730fe.tar.bz2
[multiple changes]
2004-02-23 Ed Schonberg <schonberg@gnat.com> * exp_ch6.adb (Expand_N_Subprogram_Declaration): Do not create protected operations if original subprogram is flagged as eliminated. (Expand_N_Subprogram_Body): For a protected operation, create discriminals for next operation before checking whether the operation is eliminated. * exp_ch9.adb (Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration): Do not generate specs and bodies for internal protected operations if the original subprogram is eliminated. * sem_elim.adb (Check_Eliminated): Handle properly protected operations declared in a single protected object. 2004-02-23 Vincent Celier <celier@gnat.com> * prj-attr.adb: Make attribute Builder'Executable an associative array, case insensitive if file names are case insensitive, instead of a standard associative array. * prj-attr.adb (Initialize): For 'b' associative arrays, do not set them as case insensitive on platforms where the file names are case sensitive. * prj-part.adb (Parse_Single_Project): Make sure, when checking if project file has already been parsed that canonical path are compared. 2004-02-23 Robert Dewar <dewar@gnat.com> * sinput-c.ads: Correct bad unit title in header * freeze.adb: Minor reformatting 2004-02-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * trans.c (tree_transform, case N_Procedure_Call_Statement): For nonaddressable COMPONENT_REF that is removing padding that we are taking the address of, take the address of the padded record instead if item is variable size. From-SVN: r78292
Diffstat (limited to 'gcc/ada/sem_elim.adb')
-rw-r--r--gcc/ada/sem_elim.adb27
1 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ada/sem_elim.adb b/gcc/ada/sem_elim.adb
index c5c6b3a..2a6ead4 100644
--- a/gcc/ada/sem_elim.adb
+++ b/gcc/ada/sem_elim.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2004 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- --
@@ -232,6 +232,29 @@ package body Sem_Elim is
Ctr : Nat;
Ent : Entity_Id;
+ function Original_Chars (S : Entity_Id) return Name_Id;
+ -- If the candidate subprogram is a protected operation of a single
+ -- protected object, the scope of the operation is the created
+ -- protected type, and we have to retrieve the original name of
+ -- the object.
+
+ --------------------
+ -- Original_Chars --
+ --------------------
+
+ function Original_Chars (S : Entity_Id) return Name_Id is
+ begin
+ if Ekind (S) /= E_Protected_Type
+ or else Comes_From_Source (S)
+ then
+ return Chars (S);
+ else
+ return Chars (Defining_Identifier (Original_Node (Parent (S))));
+ end if;
+ end Original_Chars;
+
+ -- Start of processing for Check_Eliminated
+
begin
if No_Elimination then
return;
@@ -270,7 +293,7 @@ package body Sem_Elim is
Scop := Scope (E);
if Elmt.Entity_Scope /= null then
for J in reverse Elmt.Entity_Scope'Range loop
- if Elmt.Entity_Scope (J) /= Chars (Scop) then
+ if Elmt.Entity_Scope (J) /= Original_Chars (Scop) then
goto Continue;
end if;