When an access-to-subprogram type is qualified as not null, then the
compiler is likely to generate a more efficient code. This patch adds
such qualifiers to the internal runtime bodies, so no clients of those
runtime units are affected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/g-alleve.adb (Bit_Operation): Now a not-null type.
* libgnat/g-sechas.adb (Fill_Buffer_Access): Likewise.
* libgnat/s-dwalin.adb (Callback): Likewise.
diff --git a/gcc/ada/libgnat/g-alleve.adb b/gcc/ada/libgnat/g-alleve.adb
--- a/gcc/ada/libgnat/g-alleve.adb
+++ b/gcc/ada/libgnat/g-alleve.adb
@@ -258,7 +258,7 @@ package body GNAT.Altivec.Low_Level_Vectors is
pragma Convention (LL_Altivec, vspltisx);
type Bit_Operation is
- access function
+ not null access function
(Value : Component_Type;
Amount : Natural) return Component_Type;
diff --git a/gcc/ada/libgnat/g-sechas.adb b/gcc/ada/libgnat/g-sechas.adb
--- a/gcc/ada/libgnat/g-sechas.adb
+++ b/gcc/ada/libgnat/g-sechas.adb
@@ -38,7 +38,7 @@ package body GNAT.Secure_Hashes is
"0123456789abcdef";
type Fill_Buffer_Access is
- access procedure
+ not null access procedure
(M : in out Message_State;
SEA : Stream_Element_Array;
First : Stream_Element_Offset;
diff --git a/gcc/ada/libgnat/s-dwalin.adb b/gcc/ada/libgnat/s-dwalin.adb
--- a/gcc/ada/libgnat/s-dwalin.adb
+++ b/gcc/ada/libgnat/s-dwalin.adb
@@ -130,7 +130,7 @@ package body System.Dwarf_Lines is
Code : uint32) return String;
-- Extract a file name from the prologue
- type Callback is access procedure (C : in out Dwarf_Context);
+ type Callback is not null access procedure (C : in out Dwarf_Context);
procedure For_Each_Row (C : in out Dwarf_Context; F : Callback);
-- Traverse each .debug_line entry with a callback