Skip to content

Commit 017c1a4

Browse files
committed
Merge branch 'pmderodat/rts_deps' into 'master'
GNATcov_RTS: remove dependencies on Interfaces/Interfaces.C Closes #163 See merge request eng/das/cov/gnatcoverage!334 Closes eng/das/cov/gnatcoverage#163
2 parents 5571092 + 2525333 commit 017c1a4

7 files changed

+64
-9
lines changed

tools/gnatcov/rts/gcvrt.ads

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
------------------------------------------------------------------------------
1818

1919
-- Namespace for units generated for instrumentation purposes
20+
--
21+
-- This unit needs to be compilable with Ada 95 compilers
2022

2123
package GCVRT is
2224
pragma Pure;

tools/gnatcov/rts/gnatcov_rts-buffers.ads

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@
2828
--
2929
-- This unit needs to be compilable with Ada 95 compilers.
3030

31-
with Interfaces;
32-
with Interfaces.C; use Interfaces.C;
33-
3431
with System;
35-
with System.Storage_Elements;
3632

33+
with GNATcov_RTS.Types; use GNATcov_RTS.Types;
3734
with GNATcov_RTS.Strings; use GNATcov_RTS.Strings;
3835

3936
package GNATcov_RTS.Buffers is
@@ -68,8 +65,10 @@ package GNATcov_RTS.Buffers is
6865
type Any_Language_Kind is (Unit_Based_Language, File_Based_Language);
6966
pragma Convention (C, Any_Language_Kind);
7067

71-
type Fingerprint_Type is
72-
new System.Storage_Elements.Storage_Array (1 .. 20);
68+
type Fingerprint_Type is array (1 .. 20) of Unsigned_8;
69+
for Fingerprint_Type'Component_Size use 8;
70+
for Fingerprint_Type'Size use 20 * 8;
71+
7372
-- Hash type to perform consistency checks over Source Coverage
7473
-- Obligations. 20-byte to hold a SHA-1.
7574

tools/gnatcov/rts/gnatcov_rts-strings.ads

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
------------------------------------------------------------------------------
2424

2525
-- Ada bindings for gnatcov_rts_c-strings.h
26+
--
27+
-- This unit needs to be compilable with Ada 95 compilers
2628

27-
with Interfaces.C; use Interfaces.C;
29+
with GNATcov_RTS.Types; use GNATcov_RTS.Types;
2830

2931
package GNATcov_RTS.Strings is
3032

tools/gnatcov/rts/gnatcov_rts-traces-output-base64.ads

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424

2525
-- This unit needs to be compilable with Ada 95 compilers
2626

27-
with Interfaces; use Interfaces;
28-
2927
with GNATcov_RTS.Buffers.Lists; use GNATcov_RTS.Buffers.Lists;
28+
with GNATcov_RTS.Types; use GNATcov_RTS.Types;
3029

3130
package GNATcov_RTS.Traces.Output.Base64 is
3231

tools/gnatcov/rts/gnatcov_rts-traces-output.ads

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
------------------------------------------------------------------------------
2424

2525
-- Namespace for all support packages required to dump traces
26+
--
27+
-- This unit needs to be compilable with Ada 95 compilers
2628

2729
package GNATcov_RTS.Traces.Output is
2830

31+
pragma Pure;
32+
2933
end GNATcov_RTS.Traces.Output;

tools/gnatcov/rts/gnatcov_rts-traces.ads

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
-- --
2323
------------------------------------------------------------------------------
2424

25+
-- This unit needs to be compilable with Ada 95 compilers
26+
2527
package GNATcov_RTS.Traces is
2628

2729
pragma Pure;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
------------------------------------------------------------------------------
2+
-- --
3+
-- GNATcoverage Instrumentation Runtime --
4+
-- --
5+
-- Copyright (C) 2021-2023, AdaCore --
6+
-- --
7+
-- GNATcoverage is free software; you can redistribute it and/or modify it --
8+
-- under terms of the GNU General Public License as published by the Free --
9+
-- Software Foundation; either version 3, or (at your option) any later --
10+
-- version. This software is distributed in the hope that it will be useful --
11+
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
12+
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
13+
-- --
14+
-- As a special exception under Section 7 of GPL version 3, you are granted --
15+
-- additional permissions described in the GCC Runtime Library Exception, --
16+
-- version 3.1, as published by the Free Software Foundation. --
17+
-- --
18+
-- You should have received a copy of the GNU General Public License and --
19+
-- a copy of the GCC Runtime Library Exception along with this program; --
20+
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
21+
-- <http://www.gnu.org/licenses/>. --
22+
-- --
23+
------------------------------------------------------------------------------
24+
25+
-- Basic types to use in source trace buffers. We try to avoid using types
26+
-- from Interfaces and Interfaces.C, and in general to minimize the set of
27+
-- dependencies of GNATcov_RTS on the Ada runtime, so that we can compute code
28+
-- coverage for these runtime units.
29+
--
30+
-- This unit needs to be compilable with Ada 95 compilers
31+
32+
with System;
33+
34+
package GNATcov_RTS.Types is
35+
36+
pragma Pure;
37+
38+
type Unsigned_8 is mod 2 ** 8;
39+
type Unsigned_64 is mod 2 ** 64;
40+
41+
-- We assume here that Integer (Ada) is a correct mapping for int (C)
42+
43+
type int is new Integer;
44+
type unsigned is mod 2 ** int'Size;
45+
type size_t is mod System.Memory_Size;
46+
47+
end GNATcov_RTS.Types;

0 commit comments

Comments
 (0)