[clang] faef68b - Revert "[Coverage] Map regions from system headers (#76950)"
NAKAMURA Takumi via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 26 22:14:46 PST 2024
Author: NAKAMURA Takumi
Date: 2024-01-27T15:11:37+09:00
New Revision: faef68bca852d08511ea0311d8a0d221cb202e73
URL: https://github.com/llvm/llvm-project/commit/faef68bca852d08511ea0311d8a0d221cb202e73
DIFF: https://github.com/llvm/llvm-project/commit/faef68bca852d08511ea0311d8a0d221cb202e73.diff
LOG: Revert "[Coverage] Map regions from system headers (#76950)"
See #78920.
This reverts commit ce3e767ac5ea1a1d1a166e88c152e2125ec7662b.
Added:
Modified:
clang/lib/CodeGen/CodeGenPGO.cpp
clang/lib/CodeGen/CoverageMappingGen.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index 5d7c3847745762..d68844d476eb4e 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -28,8 +28,6 @@ static llvm::cl::opt<bool>
llvm::cl::desc("Enable value profiling"),
llvm::cl::Hidden, llvm::cl::init(false));
-extern llvm::cl::opt<bool> SystemHeadersCoverage;
-
using namespace clang;
using namespace CodeGen;
@@ -1024,7 +1022,7 @@ bool CodeGenPGO::skipRegionMappingForDecl(const Decl *D) {
// Don't map the functions in system headers.
const auto &SM = CGM.getContext().getSourceManager();
auto Loc = D->getBody()->getBeginLoc();
- return !SystemHeadersCoverage && SM.isInSystemHeader(Loc);
+ return SM.isInSystemHeader(Loc);
}
void CodeGenPGO::emitCounterRegionMapping(const Decl *D) {
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index 5eca00f22bb83c..8b5e6c4ad8272f 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -37,7 +37,7 @@ static llvm::cl::opt<bool> EmptyLineCommentCoverage(
"disable it on test)"),
llvm::cl::init(true), llvm::cl::Hidden);
-llvm::cl::opt<bool> SystemHeadersCoverage(
+static llvm::cl::opt<bool> SystemHeadersCoverage(
"system-headers-coverage",
llvm::cl::desc("Enable collecting coverage from system headers"),
llvm::cl::init(false), llvm::cl::Hidden);
More information about the cfe-commits
mailing list