aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/Stmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/Stmt.h')
-rw-r--r--include/clang/AST/Stmt.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index e5fa309992..5d1c6dc207 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -235,23 +235,14 @@ public:
virtual void Destroy(ASTContext& Ctx);
- // hasSolitaryDecl - This method returns true if this DeclStmt refers
- // to a single Decl.
+ /// hasSolitaryDecl - This method returns true if this DeclStmt refers
+ /// to a single Decl.
bool hasSolitaryDecl() const {
- return DG.hasSolitaryDecl();
+ return DG.isSingleDecl();
}
- const Decl* getSolitaryDecl() const {
- assert (hasSolitaryDecl() &&
- "Caller assumes this DeclStmt points to one Decl*");
- return *DG.begin();
- }
-
- Decl* getSolitaryDecl() {
- assert (hasSolitaryDecl() &&
- "Caller assumes this DeclStmt points to one Decl*");
- return *DG.begin();
- }
+ const Decl* getSolitaryDecl() const { return DG.getSingleDecl(); }
+ Decl *getSolitaryDecl() { return DG.getSingleDecl(); }
SourceLocation getStartLoc() const { return StartLoc; }
SourceLocation getEndLoc() const { return EndLoc; }