diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 9092c3e0fa01f3139b016d05d267a89e3b07747a (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /lib/AST/StmtIterator.cpp | |
parent | 4981926bf654fe5a2c3893f24ca44106b217e71e (diff) | |
download | FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.zip FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.tar.gz |
Update clang to r84119.
Diffstat (limited to 'lib/AST/StmtIterator.cpp')
-rw-r--r-- | lib/AST/StmtIterator.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/AST/StmtIterator.cpp b/lib/AST/StmtIterator.cpp index 5c22e28..4f62b66 100644 --- a/lib/AST/StmtIterator.cpp +++ b/lib/AST/StmtIterator.cpp @@ -23,10 +23,10 @@ static inline VariableArrayType* FindVA(Type* t) { if (VariableArrayType* vat = dyn_cast<VariableArrayType>(vt)) if (vat->getSizeExpr()) return vat; - + t = vt->getElementType().getTypePtr(); } - + return NULL; } @@ -39,20 +39,20 @@ void StmtIteratorBase::NextVA() { if (p) return; - + if (inDecl()) { - if (VarDecl* VD = dyn_cast<VarDecl>(decl)) + if (VarDecl* VD = dyn_cast<VarDecl>(decl)) if (VD->Init) return; - + NextDecl(); } else if (inDeclGroup()) { - if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) + if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) if (VD->Init) return; - - NextDecl(); + + NextDecl(); } else { assert (inSizeOfTypeVA()); @@ -63,10 +63,10 @@ void StmtIteratorBase::NextVA() { void StmtIteratorBase::NextDecl(bool ImmediateAdvance) { assert (getVAPtr() == NULL); - + if (inDecl()) { assert (decl); - + // FIXME: SIMPLIFY AWAY. if (ImmediateAdvance) decl = 0; @@ -75,10 +75,10 @@ void StmtIteratorBase::NextDecl(bool ImmediateAdvance) { } else { assert (inDeclGroup()); - + if (ImmediateAdvance) ++DGI; - + for ( ; DGI != DGE; ++DGI) if (HandleDecl(*DGI)) return; @@ -88,18 +88,18 @@ void StmtIteratorBase::NextDecl(bool ImmediateAdvance) { } bool StmtIteratorBase::HandleDecl(Decl* D) { - - if (VarDecl* VD = dyn_cast<VarDecl>(D)) { + + if (VarDecl* VD = dyn_cast<VarDecl>(D)) { if (VariableArrayType* VAPtr = FindVA(VD->getType().getTypePtr())) { setVAPtr(VAPtr); return true; } - + if (VD->getInit()) return true; } else if (TypedefDecl* TD = dyn_cast<TypedefDecl>(D)) { - if (VariableArrayType* VAPtr = + if (VariableArrayType* VAPtr = FindVA(TD->getUnderlyingType().getTypePtr())) { setVAPtr(VAPtr); return true; @@ -110,7 +110,7 @@ bool StmtIteratorBase::HandleDecl(Decl* D) { return true; } - return false; + return false; } StmtIteratorBase::StmtIteratorBase(Decl* d) @@ -130,19 +130,19 @@ StmtIteratorBase::StmtIteratorBase(VariableArrayType* t) } Stmt*& StmtIteratorBase::GetDeclExpr() const { - + if (VariableArrayType* VAPtr = getVAPtr()) { assert (VAPtr->SizeExpr); return VAPtr->SizeExpr; } assert (inDecl() || inDeclGroup()); - + if (inDeclGroup()) { VarDecl* VD = cast<VarDecl>(*DGI); return *VD->getInitAddress(); } - + assert (inDecl()); if (VarDecl* VD = dyn_cast<VarDecl>(decl)) { |