aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2021-08-12 15:05:23 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-10-01 06:13:38 +0000
commit3323aa7ee7dd0cd9364816c80afae31d0dc7b186 (patch)
tree4234de252ea55fff23ec680fe9dec538467aa86d /gcc/ada
parentddd1ab30e6cb24b574752e011e2b798525bf4ef5 (diff)
downloadgcc-3323aa7ee7dd0cd9364816c80afae31d0dc7b186.zip
gcc-3323aa7ee7dd0cd9364816c80afae31d0dc7b186.tar.gz
gcc-3323aa7ee7dd0cd9364816c80afae31d0dc7b186.tar.bz2
[Ada] Fix CodePeer warnings
gcc/ada/ * atree.adb (Print_Statistics): Help CodePeer see Total as greater than zero. * gen_il-gen.adb (One_Comp): Annotate Field_Table as Modified.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/atree.adb4
-rw-r--r--gcc/ada/gen_il-gen.adb1
2 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index 5af4b13..ce92548 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -2503,6 +2503,10 @@ package body Atree is
Total := G_Total + S_Total;
end loop;
+ -- This assertion helps CodePeer understand that Total cannot be 0 (this
+ -- is true because GNAT does not attempt to compile empty files).
+ pragma Assert (Total > 0);
+
Write_Int_64 (Total);
Write_Str (" (100%) = ");
Write_Int_64 (G_Total);
diff --git a/gcc/ada/gen_il-gen.adb b/gcc/ada/gen_il-gen.adb
index e3b034a..dd8487d 100644
--- a/gcc/ada/gen_il-gen.adb
+++ b/gcc/ada/gen_il-gen.adb
@@ -2347,6 +2347,7 @@ package body Gen_IL.Gen is
procedure One_Comp (F : Field_Enum);
procedure One_Comp (F : Field_Enum) is
+ pragma Annotate (Codepeer, Modified, Field_Table);
Offset : constant Field_Offset := Field_Table (F).Offset;
begin
if First_Time then