aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-07 23:09:49 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-07 23:09:49 +0000
commit8ffb159441e923322bef6b5dee1aaf24c738d75e (patch)
tree7de360cf9761bbfea545f1ea1f469dc0a9ae7942 /lib/AST/Stmt.cpp
parent2c3352b5d1f5f4546af2f3051a304d84d57c697e (diff)
Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ScopedDecl*.
This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index fbb369f387..f30e105b17 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -55,7 +55,7 @@ void Stmt::Destroy(ASTContext& C) {
}
void DeclStmt::Destroy(ASTContext& C) {
- TheDecl->Destroy(C);
+ DG.Destroy(C);
delete this;
}
@@ -188,16 +188,12 @@ ObjCAtCatchStmt::ObjCAtCatchStmt(SourceLocation atCatchLoc,
//===----------------------------------------------------------------------===//
// DeclStmt
-Stmt::child_iterator DeclStmt::child_begin() { return TheDecl; }
-Stmt::child_iterator DeclStmt::child_end() { return child_iterator(); }
-
-DeclStmt::decl_iterator& DeclStmt::decl_iterator::operator++() {
- D = D->getNextDeclarator();
- return *this;
+Stmt::child_iterator DeclStmt::child_begin() {
+ return StmtIterator(DG.begin(), DG.end());
}
-bool DeclStmt::hasSolitaryDecl() const {
- return TheDecl->getNextDeclarator() == 0;
+Stmt::child_iterator DeclStmt::child_end() {
+ return StmtIterator(DG.end(), DG.end());
}
// NullStmt