diff options
author | Justin Bogner <mail@justinbogner.com> | 2015-04-28 06:31:55 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2015-04-28 06:31:55 +0000 |
commit | f959febf7af3ba5681745845d55489748d8f9ebf (patch) | |
tree | c866c89e4cf6dc76ab00f5b3c891b5d34d6b5880 /clang/lib/CodeGen/CoverageMappingGen.cpp | |
parent | 2a661cd062625ce6155c465d4baab8ef7d99becd (diff) | |
download | bcm5719-llvm-f959febf7af3ba5681745845d55489748d8f9ebf.tar.gz bcm5719-llvm-f959febf7af3ba5681745845d55489748d8f9ebf.zip |
InstrProf: Mark code regions after throw expressions as unreachable
We weren't setting regions as being unreachable after C++ throw
expressions, leading to incorrect count propagations.
llvm-svn: 235967
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r-- | clang/lib/CodeGen/CoverageMappingGen.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp index 11b9478262a..73afeda3572 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -592,6 +592,13 @@ struct CounterCoverageMappingBuilder terminateRegion(S); } + void VisitCXXThrowExpr(const CXXThrowExpr *E) { + extendRegion(E); + if (E->getSubExpr()) + Visit(E->getSubExpr()); + terminateRegion(E); + } + void VisitGotoStmt(const GotoStmt *S) { terminateRegion(S); } void VisitLabelStmt(const LabelStmt *S) { |