diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-05 20:46:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-05 20:46:55 +0000 |
commit | 4f8792b616721253c41c2342acbf9376b47f0745 (patch) | |
tree | dcc7b957f8dbdaac5af5173ec9a9e5c5986ae2f7 /clang/lib/Analysis/LiveVariables.cpp | |
parent | dd514e01f2c5267b138fdc0a80a3fce08526bba6 (diff) | |
download | bcm5719-llvm-4f8792b616721253c41c2342acbf9376b47f0745.tar.gz bcm5719-llvm-4f8792b616721253c41c2342acbf9376b47f0745.zip |
Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead. Will update other clients after additional testing.
llvm-svn: 54368
Diffstat (limited to 'clang/lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index 8f391dc5618..f5a7fb40c77 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -229,8 +229,9 @@ void TransferFuncs::VisitAssign(BinaryOperator* B) { void TransferFuncs::VisitDeclStmt(DeclStmt* DS) { // Declarations effectively "kill" a variable since they cannot // possibly be live before they are declared. - for (ScopedDecl* D = DS->getDecl(); D != NULL; D = D->getNextDeclarator()) - if (VarDecl* VD = dyn_cast<VarDecl>(D)) { + for (DeclStmt::decl_iterator DI=DS->decl_begin(), DE = DS->decl_end(); + DI != DE; ++DI) + if (VarDecl* VD = dyn_cast<VarDecl>(*DI)) { // Update liveness information. unsigned bit = AD.getIdx(VD); |