summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-27 08:49:55 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-27 08:49:55 +0000
commita735d663a439ee76661cc10a189daa162e049d13 (patch)
treeda60cbc457c2d67cba5c142c15adad7c00a41d7f /gcc
parentb00842238be6a5935221715e8fdcfd5e045326d2 (diff)
downloadgcc-a735d663a439ee76661cc10a189daa162e049d13.tar.gz
2008-05-27 Ed Schonberg <schonberg@adacore.com>
* exp_disp.adb (Build_Dispatch_Tables): For a private type completed by a synchronized tagged type, do not attempt to build dispatch table for full view. The table is built for the corresponding record type, which has its own declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135978 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_disp.adb23
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index 860fd17352c..864206951f6 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -173,25 +173,28 @@ package body Exp_Disp is
-- Handle private types of library level tagged types. We must
-- exchange the private and full-view to ensure the correct
- -- expansion.
+ -- expansion. If the full view is a synchronized type ignore
+ -- the type because the table will be built for the corresponding
+ -- record type, that has its own declaration.
elsif (Nkind (D) = N_Private_Type_Declaration
or else Nkind (D) = N_Private_Extension_Declaration)
and then Present (Full_View (Defining_Entity (D)))
- and then Is_Library_Level_Tagged_Type
- (Full_View (Defining_Entity (D)))
- and then Ekind (Full_View (Defining_Entity (D)))
- /= E_Record_Subtype
then
declare
E1 : constant Entity_Id := Defining_Entity (D);
- E2 : constant Entity_Id := Full_View (Defining_Entity (D));
+ E2 : constant Entity_Id := Full_View (E1);
begin
- Exchange_Declarations (E1);
- Insert_List_After_And_Analyze (Last (Target_List),
- Make_DT (E1));
- Exchange_Declarations (E2);
+ if Is_Library_Level_Tagged_Type (E2)
+ and then Ekind (E2) /= E_Record_Subtype
+ and then not Is_Concurrent_Type (E2)
+ then
+ Exchange_Declarations (E1);
+ Insert_List_After_And_Analyze (Last (Target_List),
+ Make_DT (E1));
+ Exchange_Declarations (E2);
+ end if;
end;
end if;