Commit 35262047 by Arnaud Charlet

[multiple changes]

2009-06-23  Pascal Obry  <obry@adacore.com>

	* s-strhas.adb, s-strhas.ads: Minor reformatting.

2009-06-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch10.adb (Install_Limited_Withed_Unit): a null procedure does
	not indicate that the enclosing unit needs a body.

From-SVN: r148836
parent abe19d88
2009-06-23 Pascal Obry <obry@adacore.com>
* s-strhas.adb, s-strhas.ads: Minor reformatting.
2009-06-23 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Limited_Withed_Unit): a null procedure does
not indicate that the enclosing unit needs a body.
2009-06-23 Emmanuel Briot <briot@adacore.com>
* prj-conf.ads, prj-conf.adb: New files part of the project manager.
......
......@@ -35,18 +35,26 @@ package body System.String_Hash is
-- the algorithm used in GNU Awk and the ndbm substitute SDBM by
-- Ozan Yigit.
function Hash (Key : Key_Type) return Hash_Type
is
----------
-- Hash --
----------
function Hash (Key : Key_Type) return Hash_Type is
function Shift_Left
(Value : Hash_Type; Amount : Natural) return Hash_Type;
(Value : Hash_Type;
Amount : Natural) return Hash_Type;
pragma Import (Intrinsic, Shift_Left);
H : Hash_Type := 0;
H : Hash_Type;
begin
H := 0;
for J in Key'Range loop
H := Char_Type'Pos (Key (J))
+ Shift_Left (H, 6) + Shift_Left (H, 16) - H;
+ Shift_Left (H, 6) + Shift_Left (H, 16) - H;
end loop;
return H;
end Hash;
......
......@@ -42,16 +42,16 @@ package System.String_Hash is
generic
type Char_Type is (<>);
-- The character type composing the key string type.
-- The character type composing the key string type
type Key_Type is array (Positive range <>) of Char_Type;
-- The string type to use as a hash key.
-- The string type to use as a hash key
type Hash_Type is mod <>;
-- The type to be returned as a hash value.
-- The type to be returned as a hash value
function Hash (Key : Key_Type) return Hash_Type;
pragma Inline (Hash);
-- Compute a hash value for a key.
-- Compute a hash value for a key
end System.String_Hash;
......@@ -4140,19 +4140,29 @@ package body Sem_Ch10 is
end;
-- Finally, check whether there are subprograms that still
-- require a body.
-- require a body, i.e. are not renamings or null.
if not Is_Empty_Elmt_List (Subp_List) then
declare
Subp_Id : Elmt_Id;
Spec : Node_Id;
begin
Subp_Id := First_Elmt (Subp_List);
Spec := Parent (Node (Subp_Id));
while Present (Subp_Id) loop
if Nkind (Parent (Parent (Node (Subp_Id))))
/= N_Subprogram_Renaming_Declaration
if Nkind (Parent (Spec))
= N_Subprogram_Renaming_Declaration
then
null;
elsif Nkind (Spec) = N_Procedure_Specification
and then Null_Present (Spec)
then
null;
else
Set_Body_Required (Library_Unit (N));
return;
end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment