]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Add Dump_Buffers hooks for code coverage
authorRonan Desplanques <desplanques@adacore.com>
Wed, 15 May 2024 12:35:59 +0000 (14:35 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 20 Jun 2024 08:50:52 +0000 (10:50 +0200)
The purpose of this patch is to make it possible to set up code
coverage for the GNAT front end in gnat1 using GNATcoverage. It is
not obvious how to have GNATcoverage instrument gnat1's main function,
and since the front end has a clear entry point (Gnat1drv), we add
manual instrumentation annotations there.

gcc/ada/

* gnat1drv.adb (Gnat1drv): Add coverage instrumentation
annotations.

gcc/ada/gnat1drv.adb

index 754dab82862d1d31f8c53972047b0192016313e0..9743dfd4c4c90a1174a8d55c8ad8647444d1787a 100644 (file)
@@ -1526,6 +1526,8 @@ begin
             Check_Rep_Info;
          end if;
 
+         pragma Annotate (Xcov, Dump_Buffers);
+
          return;
       end if;
 
@@ -1679,6 +1681,8 @@ begin
       Atree.Print_Statistics;
    end if;
 
+   pragma Annotate (Xcov, Dump_Buffers);
+
 --  The outer exception handler handles an unrecoverable error
 
 exception
@@ -1693,6 +1697,9 @@ exception
       Set_Standard_Output;
       Source_Dump;
       Tree_Dump;
+
+      pragma Annotate (Xcov, Dump_Buffers);
+
       Exit_Program (E_Errors);
 
 end Gnat1drv;
This page took 0.059974 seconds and 5 git commands to generate.