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/CheckDeadStores.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/CheckDeadStores.cpp')
-rw-r--r-- | clang/lib/Analysis/CheckDeadStores.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CheckDeadStores.cpp b/clang/lib/Analysis/CheckDeadStores.cpp index f0d3dd1b623..38078e38236 100644 --- a/clang/lib/Analysis/CheckDeadStores.cpp +++ b/clang/lib/Analysis/CheckDeadStores.cpp @@ -161,9 +161,10 @@ public: else if (DeclStmt* DS = dyn_cast<DeclStmt>(S)) // Iterate through the decls. Warn if any initializers are complex // expressions that are not live (never used). - for (ScopedDecl* SD = DS->getDecl(); SD; SD = SD->getNextDeclarator()) { + for (DeclStmt::decl_iterator DI=DS->decl_begin(), DE=DS->decl_end(); + DI != DE; ++DI) { - VarDecl* V = dyn_cast<VarDecl>(SD); + VarDecl* V = dyn_cast<VarDecl>(*DI); if (!V) continue; |