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/CodeGenPGO.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/CodeGenPGO.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index acc392a0e18..27e4c7fc091 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -317,6 +317,14 @@ struct ComputeRegionCounts : public ConstStmtVisitor<ComputeRegionCounts> { RecordNextStmtCount = true; } + void VisitCXXThrowExpr(const CXXThrowExpr *E) { + RecordStmtCount(E); + if (E->getSubExpr()) + Visit(E->getSubExpr()); + PGO.setCurrentRegionUnreachable(); + RecordNextStmtCount = true; + } + void VisitGotoStmt(const GotoStmt *S) { RecordStmtCount(S); PGO.setCurrentRegionUnreachable(); |