This is the mail archive of the
mailing list for the GCC project.
[Ada] Do full name qualification of local exception names for LLVM
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Gary Dismukes <dismukes at adacore dot com>
- Date: Tue, 13 Aug 2019 04:31:57 -0400
- Subject: [Ada] Do full name qualification of local exception names for LLVM
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 := (
procedure Local_Exception is
Local_Exc : exception;
Tested on x86_64-pc-linux-gnu, committed on trunk
2019-08-13 Gary Dismukes <email@example.com>
* exp_dbug.adb (Fully_Qualify_Name): Add full name qualification
for the E_Exception case.
@@ -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
Name_Len := Full_Qualify_Len;