From 699ef0545b0a92dfbb3708ad6854f58a8809c238 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 25 Feb 2015 01:43:27 +0000 Subject: [PATCH] Fold ParseSEHTryBlockCommon() into its only caller. No behavior change. ParseCXXTryBlockCommon() makes sense because it has two callers due to function try blocks. There are no SEH function try blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230426 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Parse/Parser.h | 1 - lib/Parse/ParseStmt.cpp | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index fd120aef29..bb23b74a4b 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1658,7 +1658,6 @@ private: // MS: SEH Statements and Blocks StmtResult ParseSEHTryBlock(); - StmtResult ParseSEHTryBlockCommon(SourceLocation Loc); StmtResult ParseSEHExceptBlock(SourceLocation Loc); StmtResult ParseSEHFinallyBlock(SourceLocation Loc); StmtResult ParseSEHLeaveStatement(); diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index c55dbea7d9..3b878e8ab1 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -408,12 +408,6 @@ StmtResult Parser::ParseExprStatement() { return Actions.ActOnExprStmt(Expr); } -StmtResult Parser::ParseSEHTryBlock() { - assert(Tok.is(tok::kw___try) && "Expected '__try'"); - SourceLocation Loc = ConsumeToken(); - return ParseSEHTryBlockCommon(Loc); -} - /// ParseSEHTryBlockCommon /// /// seh-try-block: @@ -423,7 +417,10 @@ StmtResult Parser::ParseSEHTryBlock() { /// seh-except-block /// seh-finally-block /// -StmtResult Parser::ParseSEHTryBlockCommon(SourceLocation TryLoc) { +StmtResult Parser::ParseSEHTryBlock() { + assert(Tok.is(tok::kw___try) && "Expected '__try'"); + SourceLocation TryLoc = ConsumeToken(); + if(Tok.isNot(tok::l_brace)) return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace); -- 2.40.0