From 760f032a8f12715da769dea74fde9e86e744050d Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 30 Nov 2009 14:57:12 +0000 Subject: [PATCH] 2009-11-30 Gary Dismukes * sem_prag.adb (Process_Convention): Change formal E to Ent. In the case where the pragma's entity argument is a renaming, return the entity denoted by the renaming rather than the renamed entity. Loop through the homonyms of the original argument entity, rather than the homonyms of any renamed entity. Correct call to Generate_Entity to pass the homonym. 2009-11-30 Vincent Celier * impunit.adb: Add packages that were added to the GNAT library: GNAT.SHA224, GNAT.SHA256, GNAT.SHA384 and GNAT.SHA512. * s-sechas.adb (Fill_Buffer_Copy): Fixes incorrect slice index 2009-11-30 Robert Dewar * exp_ch3.adb: Minor reformatting * g-md5.ads, g-sha1.ads: Add comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154815 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 20 ++++++++++++++++++++ gcc/ada/exp_ch3.adb | 3 +-- gcc/ada/g-md5.ads | 2 ++ gcc/ada/g-sha1.ads | 2 ++ gcc/ada/impunit.adb | 4 ++++ gcc/ada/s-sechas.adb | 2 +- gcc/ada/sem_prag.adb | 26 ++++++++++++++++++++------ 7 files changed, 50 insertions(+), 9 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5b1bd9a..d15cb8b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,23 @@ +2009-11-30 Gary Dismukes + + * sem_prag.adb (Process_Convention): Change formal E to Ent. In the + case where the pragma's entity argument is a renaming, return the + entity denoted by the renaming rather than the renamed entity. Loop + through the homonyms of the original argument entity, rather than the + homonyms of any renamed entity. Correct call to Generate_Entity to + pass the homonym. + +2009-11-30 Vincent Celier + + * impunit.adb: Add packages that were added to the GNAT library: + GNAT.SHA224, GNAT.SHA256, GNAT.SHA384 and GNAT.SHA512. + * s-sechas.adb (Fill_Buffer_Copy): Fixes incorrect slice index + +2009-11-30 Robert Dewar + + * exp_ch3.adb: Minor reformatting + * g-md5.ads, g-sha1.ads: Add comment. + 2009-11-30 Arnaud Charlet * gcc-interface/Makefile.in: Remove handling of libgccprefix, no longer diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 17e6395..f61a4a5 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -8104,8 +8104,7 @@ package body Exp_Ch3 is elsif Restriction_Active (No_Finalization) then null; - -- We skip these for CIL Value types, where finalization is not - -- available + -- Skip these for CIL Value types, where finalization is not available elsif Is_Value_Type (Tag_Typ) then null; diff --git a/gcc/ada/g-md5.ads b/gcc/ada/g-md5.ads index f9047c3..ec37642 100644 --- a/gcc/ada/g-md5.ads +++ b/gcc/ada/g-md5.ads @@ -31,6 +31,8 @@ -- -- ------------------------------------------------------------------------------ +-- Why is this package undocumented ??? + with System.Secure_Hashes.MD5; package GNAT.MD5 is new System.Secure_Hashes.H (Block_Words => System.Secure_Hashes.MD5.Block_Words, diff --git a/gcc/ada/g-sha1.ads b/gcc/ada/g-sha1.ads index e6c1bc7..a7d8e4c 100644 --- a/gcc/ada/g-sha1.ads +++ b/gcc/ada/g-sha1.ads @@ -31,6 +31,8 @@ -- -- ------------------------------------------------------------------------------ +-- Why no documentation ??? + with System.Secure_Hashes.SHA1; package GNAT.SHA1 is new System.Secure_Hashes.H (Block_Words => System.Secure_Hashes.SHA1.Block_Words, diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index 4264a5a..0f3ad57 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -263,6 +263,10 @@ package body Impunit is "g-sercom", -- GNAT.Serial_Communications "g-sestin", -- GNAT.Secondary_Stack_Info "g-sha1 ", -- GNAT.SHA1 + "g-sha224", -- GNAT.SHA224 + "g-sha256", -- GNAT.SHA256 + "g-sha384", -- GNAT.SHA384 + "g-sha512", -- GNAT.SHA512 "g-signal", -- GNAT.Signals "g-socket", -- GNAT.Sockets "g-souinf", -- GNAT.Source_Info diff --git a/gcc/ada/s-sechas.adb b/gcc/ada/s-sechas.adb index 7b84c3f..09036f3 100644 --- a/gcc/ada/s-sechas.adb +++ b/gcc/ada/s-sechas.adb @@ -85,7 +85,7 @@ package body System.Secure_Hashes is pragma Assert (Length > 0); Buf_String (M.Last + 1 .. M.Last + Length) := - S (First .. First + Length); + S (First .. First + Length - 1); M.Last := M.Last + Length; Last := First + Length - 1; end Fill_Buffer_Copy; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 7343986..cccc198 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -596,11 +596,12 @@ package body Sem_Prag is procedure Process_Compile_Time_Warning_Or_Error; -- Common processing for Compile_Time_Error and Compile_Time_Warning - procedure Process_Convention (C : out Convention_Id; E : out Entity_Id); + procedure Process_Convention + (C : out Convention_Id; Ent : out Entity_Id); -- Common processing for Convention, Interface, Import and Export. -- Checks first two arguments of pragma, and sets the appropriate -- convention value in the specified entity or entities. On return - -- C is the convention, E is the referenced entity. + -- C is the convention, Ent is the referenced entity. procedure Process_Extended_Import_Export_Exception_Pragma (Arg_Internal : Node_Id; @@ -2347,10 +2348,11 @@ package body Sem_Prag is ------------------------ procedure Process_Convention - (C : out Convention_Id; - E : out Entity_Id) + (C : out Convention_Id; + Ent : out Entity_Id) is Id : Node_Id; + E : Entity_Id; E1 : Entity_Id; Cname : Name_Id; Comp_Unit : Unit_Number_Type; @@ -2482,6 +2484,10 @@ package body Sem_Prag is E := Entity (Id); + -- Set entity to return + + Ent := E; + -- Go to renamed subprogram if present, since convention applies to -- the actual renamed entity, not to the renaming entity. If the -- subprogram is inherited, go to parent subprogram. @@ -2504,6 +2510,10 @@ package body Sem_Prag is and then Scope (E) = Scope (Alias (E)) then E := Alias (E); + + -- Return the parent subprogram the entity was inherited from + + Ent := E; end if; end if; @@ -2617,7 +2627,9 @@ package body Sem_Prag is Generate_Reference (E, Id, 'b'); end if; - E1 := E; + -- Loop through the homonyms of the pragma argument's entity + + E1 := Ent; loop E1 := Homonym (E1); exit when No (E1) or else Scope (E1) /= Current_Scope; @@ -2642,7 +2654,7 @@ package body Sem_Prag is Set_Convention_From_Pragma (E1); if Prag_Id = Pragma_Import then - Generate_Reference (E, Id, 'b'); + Generate_Reference (E1, Id, 'b'); end if; end if; end loop; @@ -3459,6 +3471,8 @@ package body Sem_Prag is else Set_Imported (Def_Id); + -- Reject an Import applied to an abstract subprogram + if Is_Subprogram (Def_Id) and then Is_Abstract_Subprogram (Def_Id) then -- 2.7.4