aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenPGO.cpp
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2021-02-03 22:57:04 -0800
committerPetr Hosek <phosek@google.com>2021-02-05 13:03:57 -0800
commit9fd9b5a9c9ece53ce36ec87e7dc8389d0f572476 (patch)
tree2f0dd616bceb7bac97e3a40a9882336f9ef30335 /clang/lib/CodeGen/CodeGenPGO.cpp
parenta34b8b879e345397880c1f9f8de4c294dd0b370c (diff)
downloadllvm-9fd9b5a9c9ece53ce36ec87e7dc8389d0f572476.zip
llvm-9fd9b5a9c9ece53ce36ec87e7dc8389d0f572476.tar.gz
llvm-9fd9b5a9c9ece53ce36ec87e7dc8389d0f572476.tar.bz2
Don't emit coverage mapping for excluded functions
When a function or a file is excluded using -fprofile-list= option, don't emit coverage mapping as doing so confuses users since those functions would always have zero count. This also reduces the binary size considerably in cases where only a few functions or files are being instrumented. Differential Revision: https://reviews.llvm.org/D96000
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index 08ae877..49b38a4 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -811,10 +811,10 @@ void CodeGenPGO::assignRegionCounters(GlobalDecl GD, llvm::Function *Fn) {
if (isa<CXXDestructorDecl>(D) && GD.getDtorType() != Dtor_Base)
return;
+ CGM.ClearUnusedCoverageMapping(D);
if (Fn->hasFnAttribute(llvm::Attribute::NoProfile))
return;
- CGM.ClearUnusedCoverageMapping(D);
setFuncName(Fn);
mapRegionCounters(D);