From 8de3cc6827afb70f4a6ce278d30549ff92a2fe49 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96892 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaChecking.cpp | 5 ++--- 1 file 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(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); -- 2.50.1