diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-22 19:15:10 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-22 19:15:10 +0000 |
commit | 4b07b2968f87f3cd5a3d8c76145f1cbfd718d42d (patch) | |
tree | c92a07839c5ff786350b17c99a1d7a68838a17fe /lib/AST/Stmt.cpp | |
parent | 804058ece0d8f692faac8518ce4d98975ba57ac2 (diff) |
Partial AST and Sema support for C++ try-catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r-- | lib/AST/Stmt.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 2308159f5d..079ed4e0da 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -14,6 +14,7 @@ #include "clang/AST/Stmt.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" +#include "clang/AST/Type.h" using namespace clang; static struct StmtClassNameTable { @@ -333,3 +334,22 @@ Stmt::child_iterator ObjCAtSynchronizedStmt::child_end() { return &SubStmts[0]+END_EXPR; } +// CXXCatchStmt +Stmt::child_iterator CXXCatchStmt::child_begin() { + return &HandlerBlock; +} + +Stmt::child_iterator CXXCatchStmt::child_end() { + return &HandlerBlock + 1; +} + +QualType CXXCatchStmt::getCaughtType() { + if (ExceptionDecl) + return llvm::cast<VarDecl>(ExceptionDecl)->getType(); + return QualType(); +} + +void CXXCatchStmt::Destroy(ASTContext& C) { + ExceptionDecl->Destroy(C); + Stmt::Destroy(C); +} |