aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-06-23 11:32:31 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-06-23 11:32:31 +0200
commit352620476c902cea186f10e68a97880edb255743 (patch)
tree552ccebad0f49026020c3ba3b37a87b8e3857526 /gcc
parentabe19d88066a6afdaf8c6917a631d21e30e4091c (diff)
downloadgcc-352620476c902cea186f10e68a97880edb255743.zip
gcc-352620476c902cea186f10e68a97880edb255743.tar.gz
gcc-352620476c902cea186f10e68a97880edb255743.tar.bz2
[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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/s-strhas.adb18
-rw-r--r--gcc/ada/s-strhas.ads8
-rw-r--r--gcc/ada/sem_ch10.adb16
4 files changed, 39 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index baef841..fb43672 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+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.
diff --git a/gcc/ada/s-strhas.adb b/gcc/ada/s-strhas.adb
index 2e3a730..158fb07 100644
--- a/gcc/ada/s-strhas.adb
+++ b/gcc/ada/s-strhas.adb
@@ -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;
diff --git a/gcc/ada/s-strhas.ads b/gcc/ada/s-strhas.ads
index bd7c7431..7e72155 100644
--- a/gcc/ada/s-strhas.ads
+++ b/gcc/ada/s-strhas.ads
@@ -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;
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 8882713..04f6f99 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -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;