public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Do full name qualification of local exception names for LLVM
@ 2019-08-13  8:33 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2019-08-13  8:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Gary Dismukes

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

Exceptions declared within subprograms are associated with objects
allocated statically (at the global level), and it's helpful for the
LLVM compiler (and likely others, such as CCG) if the exception name is
fully qualified, to avoid link name clashes (gcc-based GNAT has always
"uniquified" these names). GNAT was using the simple name for local
exceptions (as for other local objects), but it now uses fully qualified
names for all exceptions.

When compiled with the command:

gcc -c -gnatG local_exception.adb | grep "local_exception__local_exc"

the following output is generated for the test further below:

   local_exception__local_exc : static exception := (
        local_exception__local_exc'unrestricted_access));

procedure Local_Exception is

  Local_Exc : exception;

begin
   null;
end Local_Exception;

Tested on x86_64-pc-linux-gnu, committed on trunk

2019-08-13  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* exp_dbug.adb (Fully_Qualify_Name): Add full name qualification
	for the E_Exception case.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 342 bytes --]

--- gcc/ada/exp_dbug.adb
+++ gcc/ada/exp_dbug.adb
@@ -1539,6 +1539,7 @@ package body Exp_Dbug is
       elsif Is_Subprogram (Ent)
         or else Ekind (Ent) = E_Subprogram_Body
         or else Is_Type (Ent)
+        or else Ekind (Ent) = E_Exception
       then
          Fully_Qualify_Name (Ent);
          Name_Len := Full_Qualify_Len;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-13  8:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13  8:33 [Ada] Do full name qualification of local exception names for LLVM Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).