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
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index fbb369f..f30e105 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -55,7 +55,7 @@
}
void DeclStmt::Destroy(ASTContext& C) {
- TheDecl->Destroy(C);
+ DG.Destroy(C);
delete this;
}
@@ -188,16 +188,12 @@
//===----------------------------------------------------------------------===//
// 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