public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Improve the function that computes a unique name for Entities
@ 2011-09-02  9:54 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2011-09-02  9:54 UTC (permalink / raw)
  To: gcc-patches; +Cc: Johannes Kanig

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

The function Unique_Name did not actually compute a unique name for
enumeration literals, because the type to which the literal belongs was not
taken into account. This patch fixes the issue.

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

2011-09-02  Johannes Kanig  <kanig@adacore.com>

	* sem_util.adb (Unique_Name): To obtain a unique name for enumeration
	literals, take into account the type name; the type is *not*
	the scope for an enumeration literal.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 473 bytes --]

Index: sem_util.adb
===================================================================
--- sem_util.adb	(revision 178440)
+++ sem_util.adb	(working copy)
@@ -12747,6 +12747,8 @@
       then
          return Get_Name_String (Name_Standard) & "__" &
            Get_Name_String (Chars (E));
+      elsif Ekind (E) = E_Enumeration_Literal then
+         return Unique_Name (Etype (E)) & "__" & Get_Name_String (Chars (E));
 
       else
          return Get_Scoped_Name (E);

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

only message in thread, other threads:[~2011-09-02  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02  9:54 [Ada] Improve the function that computes a unique name for Entities Arnaud Charlet

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).