Skip to content

Commit fc616c8

Browse files
leocreusepmderodat
authored andcommitted
SS_Annotations: Change default backend for C/C++ sources
Stable_Sloc now offers a backend that can remap regions defined within a declaration for C & C++ sources. Use this backend by default for these languages. (cherry picked from commit 78e9c47)
1 parent e999e9f commit fc616c8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

testsuite/tests/ext_annotations/gen/invalidation/show_expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ main.adb:
33
- STALE ANNOTATION; id: exempt_ada; kind: Exempt_Region; Justification: Useless code; diagnostic: Contents of <SubpBody ["Nested"] main.adb:2:4-7:15> changed
44

55
main_c.c:
6-
- STALE ANNOTATION; id: exempt_c; kind: Exempt_Region; Justification: Useless code; diagnostic: file has been modified
6+
- STALE ANNOTATION; id: exempt_c; kind: Exempt_Region; Justification: Useless code; diagnostic: Content of declaration ident has changed

tools/gnatcov/ss_annotations.adb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,13 @@ package body SS_Annotations is
940940
case Language is
941941
when Ada_Language => SS_Backend := +"lal_context";
942942

943-
-- Stable_Sloc is missing a stable backend for C/C++, so default
944-
-- to an absolute entry.
943+
when C_Language | CPP_Language => SS_Backend := +"clang_context";
944+
945+
when All_Languages =>
946+
947+
-- This should not hit but maybe with rust coverage we may
948+
-- hit this?
945949

946-
when All_Languages | C_Language | CPP_Language =>
947950
SS_Backend := +"absolute";
948951
end case;
949952
end if;

0 commit comments

Comments
 (0)