[cfe-commits] r93413 - /cfe/trunk/lib/Sema/SemaDecl.cpp
Mike Stump
mrs at apple.com
Wed Jan 13 18:45:29 PST 2010
Author: mrs
Date: Wed Jan 13 20:45:29 2010
New Revision: 93413
URL: http://llvm.org/viewvc/llvm-project?rev=93413&view=rev
Log:
Don't assume a random access iterator, instead just use CFG::iterator.
Thanks Ted.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=93413&r1=93412&r2=93413&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Jan 13 20:45:29 2010
@@ -1344,9 +1344,9 @@
// 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
More information about the cfe-commits
mailing list