aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2008-12-22 21:35:02 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2008-12-22 21:35:02 +0000
commit8351da06ca3082dfd49dd8e3c1785a986920f57c (patch)
tree4000bf4f6263ae88d9580228d58d1631534a61ee /lib/AST/Stmt.cpp
parent27b09ac9f7a4b2555bb9adda3568f3ba6264a63e (diff)
Full AST support and better Sema support for C++ try-catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 079ed4e0da..586e8f986a 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -350,6 +350,18 @@ QualType CXXCatchStmt::getCaughtType() {
}
void CXXCatchStmt::Destroy(ASTContext& C) {
- ExceptionDecl->Destroy(C);
+ if (ExceptionDecl)
+ ExceptionDecl->Destroy(C);
Stmt::Destroy(C);
}
+
+// CXXTryStmt
+Stmt::child_iterator CXXTryStmt::child_begin() { return &Stmts[0]; }
+Stmt::child_iterator CXXTryStmt::child_end() { return &Stmts[0]+Stmts.size(); }
+
+CXXTryStmt::CXXTryStmt(SourceLocation tryLoc, Stmt *tryBlock,
+ Stmt **handlers, unsigned numHandlers)
+ : Stmt(CXXTryStmtClass), TryLoc(tryLoc) {
+ Stmts.push_back(tryBlock);
+ Stmts.insert(Stmts.end(), handlers, handlers + numHandlers);
+}