diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 1 | ||||
-rw-r--r-- | include/clang/AST/Stmt.h | 28 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticParseKinds.td | 3 | ||||
-rw-r--r-- | include/clang/Basic/StmtNodes.td | 1 | ||||
-rw-r--r-- | include/clang/Sema/Scope.h | 8 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 2 | ||||
-rw-r--r-- | include/clang/Serialization/ASTBitCodes.h | 1 |
7 files changed, 43 insertions, 1 deletions
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index ae4ff4b1f8..46585d64cd 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -2202,6 +2202,7 @@ DEF_TRAVERSE_STMT(UnresolvedMemberExpr, { }) DEF_TRAVERSE_STMT(SEHTryStmt, {}) +DEF_TRAVERSE_STMT(SEHLeaveStmt, {}) DEF_TRAVERSE_STMT(SEHExceptStmt, {}) DEF_TRAVERSE_STMT(SEHFinallyStmt,{}) diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 042c513552..e43a6f93fc 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -1889,6 +1889,34 @@ public: static bool classof(SEHTryStmt *) { return true; } }; +class SEHLeaveStmt : public Stmt { + SourceLocation LeaveLoc; + + SEHLeaveStmt(SourceLocation LeaveLoc); + + friend class ASTReader; + friend class ASTStmtReader; + explicit SEHLeaveStmt(EmptyShell E) : Stmt(SEHLeaveStmtClass, E) { } + +public: + static SEHLeaveStmt* Create(ASTContext &C, + SourceLocation LeaveLoc); + + SourceRange getSourceRange() const LLVM_READONLY { + return SourceRange(getLeaveLoc()); + } + + SourceLocation getLeaveLoc() const { return LeaveLoc; } + + child_range children() { return child_range(); } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == SEHLeaveStmtClass; + } + + static bool classof(SEHLeaveStmt *) { return true; } +}; + } // end namespace clang #endif diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index e4e339aefc..5608fa8755 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -740,6 +740,9 @@ def err_seh___except_filter : Error< def err_seh___finally_block : Error< "%0 only allowed in __finally block">; + +def err_seh___try_block : Error< + "%0 only allowed in __try block">; } // end of Parse Issue category. diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index 06da94708f..46ae07f7a6 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -164,6 +164,7 @@ def OpaqueValueExpr : DStmt<Expr>; // Microsoft Extensions. def CXXUuidofExpr : DStmt<Expr>; def SEHTryStmt : Stmt; +def SEHLeaveStmt : Stmt; def SEHExceptStmt : Stmt; def SEHFinallyStmt : Stmt; def MSDependentExistsStmt : Stmt; diff --git a/include/clang/Sema/Scope.h b/include/clang/Sema/Scope.h index b78556e65a..201b2e7a40 100644 --- a/include/clang/Sema/Scope.h +++ b/include/clang/Sema/Scope.h @@ -82,7 +82,10 @@ public: SwitchScope = 0x800, /// TryScope - This is the scope of a C++ try statement. - TryScope = 0x1000 + TryScope = 0x1000, + + /// SEHTryScope - This is scope of a Microsoft SEH try statement. + SEHTryScope = 0x2000 }; private: /// The parent scope for this scope. This is null for the translation-unit @@ -292,6 +295,9 @@ public: /// \brief Determine whether this scope is a C++ 'try' block. bool isTryScope() const { return getFlags() & Scope::TryScope; } + /// \brief Determine whether this scope is a MS SEH 'try' block. + bool isSEHTryScope() const { return getFlags() & Scope::SEHTryScope; } + /// containedInPrototypeScope - Return true if this or a parent scope /// is a FunctionPrototypeScope. bool containedInPrototypeScope() const; diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 5fdb09caea..fd0cd9c397 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -2622,6 +2622,8 @@ public: Stmt *TryBlock, Stmt *Handler); + StmtResult ActOnSEHLeaveStmt(SourceLocation LeaveLoc); + StmtResult ActOnSEHExceptBlock(SourceLocation Loc, Expr *FilterExpr, Stmt *Block); diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h index f2134134ae..25303efcf2 100644 --- a/include/clang/Serialization/ASTBitCodes.h +++ b/include/clang/Serialization/ASTBitCodes.h @@ -1204,6 +1204,7 @@ namespace clang { STMT_SEH_EXCEPT, // SEHExceptStmt STMT_SEH_FINALLY, // SEHFinallyStmt STMT_SEH_TRY, // SEHTryStmt + STMT_SEH_LEAVE, // SEHLeaveStmt // ARC EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr |