Author: smeenai Date: Thu Jun 7 15:24:20 2018 New Revision: 334240 URL: http://llvm.org/viewvc/llvm-project?rev=334240&view=rev Log: Revert "[Parse] Use CapturedStmt for @finally on MSVC"
This reverts commit r334224. This is causing buildbot failures on Windows, presumably because some tests don't specify a triple. I'll test this on Windows locally and recommit with the tests fixed. Removed: cfe/trunk/test/SemaObjC/finally-msvc.m Modified: cfe/trunk/include/clang/AST/Stmt.h cfe/trunk/include/clang/Basic/CapturedStmt.h cfe/trunk/include/clang/Sema/ScopeInfo.h cfe/trunk/lib/Parse/ParseObjc.cpp Modified: cfe/trunk/include/clang/AST/Stmt.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=334240&r1=334239&r2=334240&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Stmt.h (original) +++ cfe/trunk/include/clang/AST/Stmt.h Thu Jun 7 15:24:20 2018 @@ -2133,7 +2133,7 @@ private: /// The pointer part is the implicit the outlined function and the /// int part is the captured region kind, 'CR_Default' etc. - llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind; + llvm::PointerIntPair<CapturedDecl *, 1, CapturedRegionKind> CapDeclAndKind; /// The record for captured variables, a RecordDecl or CXXRecordDecl. RecordDecl *TheRecordDecl = nullptr; Modified: cfe/trunk/include/clang/Basic/CapturedStmt.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/CapturedStmt.h?rev=334240&r1=334239&r2=334240&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/CapturedStmt.h (original) +++ cfe/trunk/include/clang/Basic/CapturedStmt.h Thu Jun 7 15:24:20 2018 @@ -16,7 +16,6 @@ namespace clang { /// The different kinds of captured statement. enum CapturedRegionKind { CR_Default, - CR_ObjCAtFinally, CR_OpenMP }; Modified: cfe/trunk/include/clang/Sema/ScopeInfo.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ScopeInfo.h?rev=334240&r1=334239&r2=334240&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/ScopeInfo.h (original) +++ cfe/trunk/include/clang/Sema/ScopeInfo.h Thu Jun 7 15:24:20 2018 @@ -748,8 +748,6 @@ public: switch (CapRegionKind) { case CR_Default: return "default captured statement"; - case CR_ObjCAtFinally: - return "Objective-C @finally statement"; case CR_OpenMP: return "OpenMP region"; } Modified: cfe/trunk/lib/Parse/ParseObjc.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=334240&r1=334239&r2=334240&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseObjc.cpp (original) +++ cfe/trunk/lib/Parse/ParseObjc.cpp Thu Jun 7 15:24:20 2018 @@ -2585,26 +2585,13 @@ StmtResult Parser::ParseObjCTryStmt(Sour ParseScope FinallyScope(this, Scope::DeclScope | Scope::CompoundStmtScope); - bool ShouldCapture = - getTargetInfo().getTriple().isWindowsMSVCEnvironment(); - if (ShouldCapture) - Actions.ActOnCapturedRegionStart(Tok.getLocation(), getCurScope(), - CR_ObjCAtFinally, 1); - StmtResult FinallyBody(true); if (Tok.is(tok::l_brace)) FinallyBody = ParseCompoundStatementBody(); else Diag(Tok, diag::err_expected) << tok::l_brace; - - if (FinallyBody.isInvalid()) { + if (FinallyBody.isInvalid()) FinallyBody = Actions.ActOnNullStmt(Tok.getLocation()); - if (ShouldCapture) - Actions.ActOnCapturedRegionError(); - } else if (ShouldCapture) { - FinallyBody = Actions.ActOnCapturedRegionEnd(FinallyBody.get()); - } - FinallyStmt = Actions.ActOnObjCAtFinallyStmt(AtCatchFinallyLoc, FinallyBody.get()); catch_or_finally_seen = true; Removed: cfe/trunk/test/SemaObjC/finally-msvc.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/finally-msvc.m?rev=334239&view=auto ============================================================================== --- cfe/trunk/test/SemaObjC/finally-msvc.m (original) +++ cfe/trunk/test/SemaObjC/finally-msvc.m (removed) @@ -1,14 +0,0 @@ -// RUN: %clang_cc1 -triple i686--windows-msvc -fexceptions -fobjc-exceptions -ast-dump %s 2>&1 | FileCheck %s -// RUN: %clang_cc1 -triple x86_64--windows-msvc -fexceptions -fobjc-exceptions -ast-dump %s 2>&1 | FileCheck %s - -void f() { - @try { - } @finally { - } -} - -// CHECK: ObjCAtFinallyStmt -// CHECK-NEXT: CapturedStmt -// CHECK-NEXT: CapturedDecl -// CHECK-NEXT: CompoundStmt -// CHECK-NEXT: ImplicitParamDecl _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits