This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Ada] Pragma Import on library units that are generic subprograms
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Arnaud Charlet <charlet at adacore dot com>, Ed Schonberg <schonberg at adacore dot com>
- Date: Thu, 27 Mar 2008 19:54:02 +0100
- Subject: Re: [Ada] Pragma Import on library units that are generic subprograms
- References: <20080327164136.GA6661@adacore.com>
> Importing generic subprograms provides a limited form of instance sharing.
The attached patchlet is required to support them on Alpha/Tru64.
Tested on i586-suse-linux, applied on the mainline.
2008-03-27 Eric Botcazou <ebotcazou@adacore.com>
* decl.c (gnat_to_gnu_entity) <E_Procedure>: Also set the public flag
if the procedure is imported.
--
Eric Botcazou
Index: decl.c
===================================================================
--- decl.c (revision 133594)
+++ decl.c (working copy)
@@ -3550,7 +3550,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
tree gnu_ext_name = create_concat_name (gnat_entity, NULL);
Entity_Id gnat_param;
bool inline_flag = Is_Inlined (gnat_entity);
- bool public_flag = Is_Public (gnat_entity);
+ bool public_flag = Is_Public (gnat_entity) || imported_p;
bool extern_flag
= (Is_Public (gnat_entity) && !definition) || imported_p;
bool pure_flag = Is_Pure (gnat_entity);