]> granicus.if.org Git - clang/commitdiff
Revert "[Parse] Use CapturedStmt for @finally on MSVC"
authorShoaib Meenai <smeenai@fb.com>
Thu, 7 Jun 2018 22:24:20 +0000 (22:24 +0000)
committerShoaib Meenai <smeenai@fb.com>
Thu, 7 Jun 2018 22:24:20 +0000 (22:24 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334240 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Stmt.h
include/clang/Basic/CapturedStmt.h
include/clang/Sema/ScopeInfo.h
lib/Parse/ParseObjc.cpp
test/SemaObjC/finally-msvc.m [deleted file]

index 3b678dcc754f87c0bc858155e2a214c7fca09af8..03c808d394e508d3bb872c2beb5d83c90dd2514a 100644 (file)
@@ -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;
index 324e1b1d3d09329da4a5e3f1f5fa08f48817be20..6c8d6edab0b5023489cde95cc40fa9b3ae306022 100644 (file)
@@ -16,7 +16,6 @@ namespace clang {
 /// The different kinds of captured statement.
 enum CapturedRegionKind {
   CR_Default,
-  CR_ObjCAtFinally,
   CR_OpenMP
 };
 
index fa1b1037a2f71f7668af483a049e53a401e873d6..b0f6bac994675d89df9254d2d8bae4e561265bdc 100644 (file)
@@ -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";
     }
index ff33d5fb96bc215ffb2cdf400287db8e7c3ccb91..6ca0ad855f54064d55293ed9f948692384348b1f 100644 (file)
@@ -2585,26 +2585,13 @@ StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {
       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;
diff --git a/test/SemaObjC/finally-msvc.m b/test/SemaObjC/finally-msvc.m
deleted file mode 100644 (file)
index 5db08a7..0000000
+++ /dev/null
@@ -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