]> granicus.if.org Git - clang/commitdiff
Simplify check for basic block with a CXXTryStmt terminator.
authorTed Kremenek <kremenek@apple.com>
Tue, 23 Feb 2010 05:59:16 +0000 (05:59 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 23 Feb 2010 05:59:16 +0000 (05:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96892 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaChecking.cpp

index aa8ddf8018c1d460decfe181f6e9f4c0096dfd97..3863e1558778fe697385f09aaeed5e5847745314 100644 (file)
@@ -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);