diff options
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 40c3e754ad..75fe7fd00f 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1344,9 +1344,9 @@ void Sema::CheckUnreachable(AnalysisContext &AC) { // Mark all live things first. MarkLive(&cfg->getEntry(), live); - for (unsigned i = 0; i < cfg->getNumBlockIDs(); ++i) { - if (!live[i]) { - CFGBlock &b = *(cfg->begin()[i]); + for (CFG::iterator I = cfg->begin(), E = cfg->end(); I != E; ++I) { + CFGBlock &b = **I; + if (!live[b.getBlockID()]) { if (!b.empty()) Diag(b[0].getStmt()->getLocStart(), diag::warn_unreachable); // Avoid excessive errors by marking everything reachable from here |