diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-11 11:52:49 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-11 11:52:49 +0200 |
commit | 1aa234217483f238c07ff819178d4c64e68fa74e (patch) | |
tree | ab3bf9bffc28f40076be5787553b8c06db3dcb38 /gcc/ada/sem_attr.adb | |
parent | 9c8e862b2ed66d94be79af62b3a323f902f1032b (diff) | |
download | gcc-1aa234217483f238c07ff819178d4c64e68fa74e.zip gcc-1aa234217483f238c07ff819178d4c64e68fa74e.tar.gz gcc-1aa234217483f238c07ff819178d4c64e68fa74e.tar.bz2 |
[multiple changes]
2010-10-11 Emmanuel Briot <briot@adacore.com>
* sinfo.adb: Use GNAT.HTable rather than System.HTable.
* prj-nmsc.adb: Minor reformatting.
2010-10-11 Thomas Quinot <quinot@adacore.com>
* sem_attr.adb (Type_Key): Code simplification.
From-SVN: r165289
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 7bc4557..b07f390 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -4457,7 +4457,7 @@ package body Sem_Attr is Check_E0; Check_Type; declare - function Type_Key return String; + function Type_Key return String_Id; -- A very preliminary implementation. -- For now, a signature consists of only the type name. -- This is clearly incomplete (e.g., adding a new field to @@ -4467,22 +4467,18 @@ package body Sem_Attr is -- Type_Key -- -------------- - function Type_Key return String is - + function Type_Key return String_Id is Full_Name : constant String_Id := - Fully_Qualified_Name_String (Entity (P)); - - Signature : String - (1 .. Integer (String_Length (Full_Name)) - 1); - -- Decrement length to omit trailing NUL - + Fully_Qualified_Name_String (Entity (P)); begin - for J in Signature'Range loop - Signature (J) := - Get_Character (Get_String_Char (Full_Name, Int (J))); - end loop; + -- Copy all characters in Full_Name but the trailing NUL - return Signature & "'Type_Key"; + Start_String; + for J in 1 .. String_Length (Full_Name) - 1 loop + Store_String_Char (Get_String_Char (Full_Name, Int (J))); + end loop; + Store_String_Chars ("'Type_Key"); + return End_String; end Type_Key; begin |