Skip to content

Commit

Permalink
coverage: Do not call __gcov_dump() when using source-based coverage
Browse files Browse the repository at this point in the history
It's useless and will do nothing.
  • Loading branch information
rgacogne committed Oct 9, 2023
1 parent e910a9d commit 827946b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pdns/coverage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
#ifdef COVERAGE
extern "C"
{
// NOLINTNEXTLINE(bugprone-reserved-identifier): not ours
void __gcov_dump(void);
#ifdef CLANG_COVERAGE
// NOLINTNEXTLINE(bugprone-reserved-identifier): not ours
int __llvm_profile_write_file(void);
#else /* CLANG_COVERAGE */
// NOLINTNEXTLINE(bugprone-reserved-identifier): not ours
void __gcov_dump(void);
#endif /* CLANG_COVERAGE */
}
#endif /* COVERAGE */
Expand All @@ -39,9 +40,10 @@ namespace pdns::coverage
void dumpCoverageData()
{
#ifdef COVERAGE
__gcov_dump();
#ifdef CLANG_COVERAGE
__llvm_profile_write_file();
#else /* CLANG_COVERAGE */
__gcov_dump();
#endif /* CLANG_COVERAGE */
#endif /* COVERAGE */
}
Expand Down

0 comments on commit 827946b

Please sign in to comment.