diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-09-27 16:56:37 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-04 16:57:55 +0100 |
commit | 39e9ebac2f2500652c14597fe6a113d5002abf2f (patch) | |
tree | b5544903645a86185867fcb371d315d8b44006bc /gcc | |
parent | ccd17b28e9bb9bd49676000c12e471a512c3a7cd (diff) | |
download | gcc-39e9ebac2f2500652c14597fe6a113d5002abf2f.zip gcc-39e9ebac2f2500652c14597fe6a113d5002abf2f.tar.gz gcc-39e9ebac2f2500652c14597fe6a113d5002abf2f.tar.bz2 |
ada: Add null exclusion to avoid run-time checks
By declaring access parameter with non-null qualifier, the compiler
should avoid generating run-time checks in debug builds, resulting in
a tiny performance improvement.
Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* sem_res.adb (Type_In_P): Add non-null qualifier.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_res.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 2ea1ae4..4c92b56 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -1589,7 +1589,7 @@ package body Sem_Res is -- expanded name, verify that the operand has an interpretation with a -- type defined in the given scope of the operator. - function Type_In_P (Test : Kind_Test) return Entity_Id; + function Type_In_P (Test : not null Kind_Test) return Entity_Id; -- Find a type of the given class in package Pack that contains the -- operator. @@ -1624,7 +1624,7 @@ package body Sem_Res is -- Type_In_P -- --------------- - function Type_In_P (Test : Kind_Test) return Entity_Id is + function Type_In_P (Test : not null Kind_Test) return Entity_Id is E : Entity_Id; function In_Decl return Boolean; |