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 | 14f8b4ff660bcaa763974b8d0fae81857c594495 (patch) | |
tree | 5dd516f4f9247a549d7ac24580412b68767162e3 /lib/Analysis/CheckDeadStores.cpp | |
parent | 88bee7451399c04b7e1c49cdeb16fadf0dd66f58 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CheckDeadStores.cpp')
-rw-r--r-- | lib/Analysis/CheckDeadStores.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/CheckDeadStores.cpp b/lib/Analysis/CheckDeadStores.cpp index f0d3dd1b62..38078e3823 100644 --- a/lib/Analysis/CheckDeadStores.cpp +++ b/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; |