aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/StmtIterator.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-07 23:35:42 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-07 23:35:42 +0000
commit8a213de1a86e5f347c6b591f52712c2fd6177cce (patch)
treec6ebe1e7cfe545cdc7238e62134dba3d34bc47e6 /lib/AST/StmtIterator.cpp
parent8ffb159441e923322bef6b5dee1aaf24c738d75e (diff)
A little more tweaking with StmtIterator and SizeOfAlignofExpr. A recent commit actually introduced a regression, not fixed a bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtIterator.cpp')
-rw-r--r--lib/AST/StmtIterator.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/lib/AST/StmtIterator.cpp b/lib/AST/StmtIterator.cpp
index 1b0e9d57c0..46882422e1 100644
--- a/lib/AST/StmtIterator.cpp
+++ b/lib/AST/StmtIterator.cpp
@@ -35,22 +35,25 @@ void StmtIteratorBase::NextVA() {
p = FindVA(p->getElementType().getTypePtr());
setVAPtr(p);
- if (!p) {
- if (inDecl()) {
- if (VarDecl* VD = dyn_cast<VarDecl>(decl))
- if (VD->Init)
- return;
-
- NextDecl();
- }
- else if (inDeclGroup()) {
- if (VarDecl* VD = dyn_cast<VarDecl>(*DGI))
- if (VD->Init)
- return;
-
- NextDecl();
- }
- } else if (inSizeOfTypeVA()) {
+ if (p)
+ return;
+
+ if (inDecl()) {
+ if (VarDecl* VD = dyn_cast<VarDecl>(decl))
+ if (VD->Init)
+ return;
+
+ NextDecl();
+ }
+ else if (inDeclGroup()) {
+ if (VarDecl* VD = dyn_cast<VarDecl>(*DGI))
+ if (VD->Init)
+ return;
+
+ NextDecl();
+ }
+ else {
+ assert (inSizeOfTypeVA());
assert(!decl);
RawVAPtr = 0;
}