summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CoverageMappingGen.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-10-14 23:38:16 +0000
committerVedant Kumar <vsk@apple.com>2016-10-14 23:38:16 +0000
commitf34d92b55bb16ecfa6cb5808c3ca455b90c85429 (patch)
tree8a09c05551b6a9810e9bac7fc7684a93661306e7 /lib/CodeGen/CoverageMappingGen.cpp
parent21c62934c7834d061a174f6865171ecf7c230cf6 (diff)
[Coverage] Support for C++17 if initializers
Differential Revision: https://reviews.llvm.org/D25572 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284293 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r--lib/CodeGen/CoverageMappingGen.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CoverageMappingGen.cpp b/lib/CodeGen/CoverageMappingGen.cpp
index 403fbceefc..530ac83611 100644
--- a/lib/CodeGen/CoverageMappingGen.cpp
+++ b/lib/CodeGen/CoverageMappingGen.cpp
@@ -875,6 +875,9 @@ struct CounterCoverageMappingBuilder
void VisitIfStmt(const IfStmt *S) {
extendRegion(S);
+ if (S->getInit())
+ Visit(S->getInit());
+
// Extend into the condition before we propagate through it below - this is
// needed to handle macros that generate the "if" but not the condition.
extendRegion(S->getCond());