diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-05-08 11:50:18 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-05-08 11:50:18 +0000 |
commit | 901ad63f3070d0f561f205618cc830486af365fb (patch) | |
tree | 5a8b840a36226645873ccea5b9a0350286f5d624 /gcc/ada/gcc-interface/decl.c | |
parent | 9c026b8767d906ad9969f287152b237d9a20258e (diff) | |
download | gcc-901ad63f3070d0f561f205618cc830486af365fb.zip gcc-901ad63f3070d0f561f205618cc830486af365fb.tar.gz gcc-901ad63f3070d0f561f205618cc830486af365fb.tar.bz2 |
exp_disp.adb (Make_Tags): Mark the imported view of dispatch tables.
* exp_disp.adb (Make_Tags): Mark the imported view of dispatch tables.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Make imported
constants really constant.
<E_Record_Subtype>: Strip the suffix for dispatch table entities.
From-SVN: r159184
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 6df79fb..fba552b 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -560,7 +560,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) && (((Nkind (Declaration_Node (gnat_entity)) == N_Object_Declaration) && Present (Expression (Declaration_Node (gnat_entity)))) - || Present (Renamed_Object (gnat_entity)))); + || Present (Renamed_Object (gnat_entity)) + || Is_Imported (gnat_entity))); bool inner_const_flag = const_flag; bool static_p = Is_Statically_Allocated (gnat_entity); bool mutable_p = false; @@ -2975,6 +2976,20 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) break; } + /* If this is a record subtype associated with a dispatch table, + strip the suffix. This is necessary to make sure 2 different + subtypes associated with the imported and exported views of a + dispatch table are properly merged in LTO mode. */ + if (Is_Dispatch_Table_Entity (gnat_entity)) + { + char *p; + Get_Encoded_Name (gnat_entity); + p = strrchr (Name_Buffer, '_'); + gcc_assert (p); + strcpy (p+1, "dtS"); + gnu_entity_name = get_identifier (Name_Buffer); + } + /* When the subtype has discriminants and these discriminants affect the initial shape it has inherited, factor them in. But for an Unchecked_Union (it must be an Itype), just return the type. |