From 9884e365dcae7a04908241df12a3a9ce063c0b61 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 23 Feb 2010 05:59:16 +0000 Subject: [PATCH] Simplify check for basic block with a CXXTryStmt terminator. llvm-svn: 96892 --- clang/lib/Sema/SemaChecking.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index aa8ddf8018c1..3863e1558778 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/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(b.getTerminator())) { + if (b.pred_empty()) { + if (!AddEHEdges && dyn_cast_or_null(b.getTerminator())) { // When not adding EH edges from calls, catch clauses // can otherwise seem dead. Avoid noting them as dead. numReachable += ScanReachableFromBlock(b, reachable);