aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-23 05:59:16 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-23 05:59:16 +0000
commit8de3cc6827afb70f4a6ce278d30549ff92a2fe49 (patch)
tree46b04944041ef950ca548eba7b9e429e054573d3 /lib/Sema/SemaChecking.cpp
parent05f62474dd2b0f1cb69adbe0787f2868788aa949 (diff)
Simplify check for basic block with a CXXTryStmt terminator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index aa8ddf8018..3863e15587 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -2278,9 +2278,8 @@ void Sema::CheckUnreachable(AnalysisContext &AC) {
for (CFG::iterator I = cfg->begin(), E = cfg->end(); I != E; ++I) {
CFGBlock &b = **I;
if (!reachable[b.getBlockID()]) {
- if (b.pred_begin() == b.pred_end()) {
- if (!AddEHEdges && b.getTerminator()
- && isa<CXXTryStmt>(b.getTerminator())) {
+ if (b.pred_empty()) {
+ if (!AddEHEdges && dyn_cast_or_null<CXXTryStmt>(b.getTerminator())) {
// When not adding EH edges from calls, catch clauses
// can otherwise seem dead. Avoid noting them as dead.
numReachable += ScanReachableFromBlock(b, reachable);