aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2024-01-24 19:17:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 20:13:49 +0000
commit7a6dacaca14b62ca4b74406814becb87a3fefac0 (patch)
tree273a870ac27484bb1f5ee55e7ef0dc0d061f63e7 /contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp
parent46c59ea9b61755455ff6bf9f3e7b834e1af634ea (diff)
parent4df029cc74e5ec124f14a5682e44999ce4f086df (diff)
downloadsrc-7a6dacaca14b62ca4b74406814becb87a3fefac0.tar.gz
src-7a6dacaca14b62ca4b74406814becb87a3fefac0.zip
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp b/contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp
index d68844d476eb..5d7c38477457 100644
--- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -28,6 +28,8 @@ 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;
@@ -1022,7 +1024,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 SM.isInSystemHeader(Loc);
+ return !SystemHeadersCoverage && SM.isInSystemHeader(Loc);
}
void CodeGenPGO::emitCounterRegionMapping(const Decl *D) {