Renamed internal variables of StmtIteratorBase to make the code
slightly more succinct.
Introduced VariableArrayType* within StmtIteratorBase to (soon)
support iteration over the size expressions of variable length arrays.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43455 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtIterator.cpp b/AST/StmtIterator.cpp
index bcf495a..7a516a7 100644
--- a/AST/StmtIterator.cpp
+++ b/AST/StmtIterator.cpp
@@ -30,12 +30,12 @@
}
void StmtIteratorBase::NextDecl() {
- assert (FirstDecl && Ptr.D);
+ assert (FirstDecl && decl);
- do Ptr.D = Ptr.D->getNextDeclarator();
- while (Ptr.D != NULL && !declHasExpr(Ptr.D));
+ do decl = decl->getNextDeclarator();
+ while (decl != NULL && !declHasExpr(decl));
- if (Ptr.D == NULL) FirstDecl = NULL;
+ if (decl == NULL) FirstDecl = NULL;
}
StmtIteratorBase::StmtIteratorBase(ScopedDecl* d) {
@@ -45,12 +45,12 @@
d = d->getNextDeclarator();
FirstDecl = d;
- Ptr.D = d;
+ decl = d;
}
void StmtIteratorBase::PrevDecl() {
assert (FirstDecl);
- assert (Ptr.D != FirstDecl);
+ assert (decl != FirstDecl);
// March through the list of decls until we find the decl just before
// the one we currently point
@@ -58,7 +58,7 @@
ScopedDecl* d = FirstDecl;
ScopedDecl* lastVD = d;
- while (d->getNextDeclarator() != Ptr.D) {
+ while (d->getNextDeclarator() != decl) {
if (VarDecl* V = dyn_cast<VarDecl>(d))
if (V->getInit())
lastVD = d;
@@ -66,14 +66,14 @@
d = d->getNextDeclarator();
}
- Ptr.D = lastVD;
+ decl = lastVD;
}
Stmt*& StmtIteratorBase::GetDeclExpr() const {
- if (VarDecl* D = dyn_cast<VarDecl>(Ptr.D))
+ if (VarDecl* D = dyn_cast<VarDecl>(decl))
return reinterpret_cast<Stmt*&>(D->Init);
else {
- EnumConstantDecl* Decl = cast<EnumConstantDecl>(Ptr.D);
+ EnumConstantDecl* Decl = cast<EnumConstantDecl>(decl);
return reinterpret_cast<Stmt*&>(Decl->Init);
}
}