aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-06 20:54:44 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-06 20:54:44 +0000
commit65aa3b9fda7b2114f708014e3d42176abc0e39ab (patch)
tree41c1d32dca3a29a15bf5f0222606c3c83edd2e14 /lib
parent15f613987a24198468a5a696adcca49f4e363ae3 (diff)
Add DeclStmt::hasSolitaryDecl() and DeclStmt::getSolitaryDecl()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57204 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/Stmt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 689fe852d8..fbb369f387 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -188,7 +188,7 @@ ObjCAtCatchStmt::ObjCAtCatchStmt(SourceLocation atCatchLoc,
//===----------------------------------------------------------------------===//
// DeclStmt
-Stmt::child_iterator DeclStmt::child_begin() { return getDecl(); }
+Stmt::child_iterator DeclStmt::child_begin() { return TheDecl; }
Stmt::child_iterator DeclStmt::child_end() { return child_iterator(); }
DeclStmt::decl_iterator& DeclStmt::decl_iterator::operator++() {
@@ -196,6 +196,10 @@ DeclStmt::decl_iterator& DeclStmt::decl_iterator::operator++() {
return *this;
}
+bool DeclStmt::hasSolitaryDecl() const {
+ return TheDecl->getNextDeclarator() == 0;
+}
+
// NullStmt
Stmt::child_iterator NullStmt::child_begin() { return child_iterator(); }
Stmt::child_iterator NullStmt::child_end() { return child_iterator(); }