aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/StmtIterator.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-23 23:38:34 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-23 23:38:34 +0000
commit35628d1f17c817f8c240208db7ba490e3109981b (patch)
tree2c10803d84f342eb2fb142b0e836a83095fb4d7b /lib/AST/StmtIterator.cpp
parent8a69366a1cd8fe1e9fd312048c0d5ce58eabeeb2 (diff)
Add StmtIterator support for iterating over both the condition
variable initializer and the other expressions in an IfStmt. This change required adding a 'DoDestroy()' method for IfStmt that did not include destroying the initializer (since that is owned by the VarDecl). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtIterator.cpp')
-rw-r--r--lib/AST/StmtIterator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/AST/StmtIterator.cpp b/lib/AST/StmtIterator.cpp
index 0f1d85c399..7fc7c96750 100644
--- a/lib/AST/StmtIterator.cpp
+++ b/lib/AST/StmtIterator.cpp
@@ -65,7 +65,7 @@ void StmtIteratorBase::NextDecl(bool ImmediateAdvance) {
assert (getVAPtr() == NULL);
if (inDecl()) {
- assert (decl);
+ assert(decl);
// FIXME: SIMPLIFY AWAY.
if (ImmediateAdvance)
@@ -74,7 +74,7 @@ void StmtIteratorBase::NextDecl(bool ImmediateAdvance) {
return;
}
else {
- assert (inDeclGroup());
+ assert(inDeclGroup());
if (ImmediateAdvance)
++DGI;
@@ -113,10 +113,10 @@ bool StmtIteratorBase::HandleDecl(Decl* D) {
return false;
}
-StmtIteratorBase::StmtIteratorBase(Decl* d)
- : stmt(0), decl(d), RawVAPtr(DeclMode) {
- assert (decl);
- NextDecl(false);
+StmtIteratorBase::StmtIteratorBase(Decl *d, Stmt **s)
+ : stmt(s), decl(d), RawVAPtr(d ? DeclMode : 0) {
+ if (decl)
+ NextDecl(false);
}
StmtIteratorBase::StmtIteratorBase(Decl** dgi, Decl** dge)