diff options
| author | Reid Kleckner <rnk@google.com> | 2019-02-26 20:42:52 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2019-02-26 20:42:52 +0000 |
| commit | f9ef9f868c82646203581d8808300874066fa14a (patch) | |
| tree | 154d4a05662255119936b529d3b3763cb86aac17 /clang/lib/CodeGen/CodeGenPGO.cpp | |
| parent | 721eaeff3a2429fecbaeb9a47ca1339cd7cb03ce (diff) | |
| download | bcm5719-llvm-f9ef9f868c82646203581d8808300874066fa14a.tar.gz bcm5719-llvm-f9ef9f868c82646203581d8808300874066fa14a.zip | |
[MS] Don't emit coverage for deleting dtors
Summary:
The MS C++ ABI has no constructor variants, but it has destructor
variants, so we should move the deleting destructor variant check
outside the check for "does the ABI have constructor variants".
Fixes PR37561, so basic code coverage works on Windows with C++.
Reviewers: vsk
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58691
llvm-svn: 354924
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index 855e2496535..d10a321dc3d 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -771,14 +771,14 @@ void CodeGenPGO::assignRegionCounters(GlobalDecl GD, llvm::Function *Fn) { // If so, instrument only base variant, others are implemented by delegation // to the base one, it would be counted twice otherwise. if (CGM.getTarget().getCXXABI().hasConstructorVariants()) { - if (isa<CXXDestructorDecl>(D) && GD.getDtorType() != Dtor_Base) - return; - if (const auto *CCD = dyn_cast<CXXConstructorDecl>(D)) if (GD.getCtorType() != Ctor_Base && CodeGenFunction::IsConstructorDelegationValid(CCD)) return; } + if (isa<CXXDestructorDecl>(D) && GD.getDtorType() != Dtor_Base) + return; + CGM.ClearUnusedCoverageMapping(D); setFuncName(Fn); |

