clang/test/Rewriter
Shoaib Meenai e8805d277d Reapply "[Parse] Use CapturedStmt for @finally on MSVC"
This reapplies r334224 and adds explicit triples to some tests to fix
them on Windows (where otherwise they would have run with the default
windows-msvc triple, which I'm changing the behavior for).

Original commit message:
The body of a `@finally` needs to be executed on both exceptional and
non-exceptional paths. On landingpad platforms, this is straightforward:
the `@finally` body is emitted as a normal (non-exceptional) cleanup,
and then a catch-all is emitted which branches to that cleanup (the
cleanup has code to conditionally re-throw based on a flag which is set
by the catch-all).

Unfortunately, we can't use the same approach for MSVC exceptions, where
the catch-all will be emitted as a catchpad. We can't just branch to the
cleanup from within the catchpad, since we can only exit it via a
catchret, at which point the exception is destroyed and we can't
rethrow. We could potentially emit the finally body inside the catchpad
and have the normal cleanup path somehow branch into it, but that would
require some new IR construct that could branch into a catchpad.

Instead, after discussing it with Reid Kleckner, we decided that
frontend outlining was the best approach, similar to how SEH `__finally`
works today. We decided to use CapturedStmt (which was also suggested by
Reid) rather than CaptureFinder (which is what `__finally` uses) since
the latter doesn't handle a lot of cases we care about, e.g. self
accesses, property accesses, block captures, etc. Extending
CaptureFinder to handle those additional cases proved unwieldy, whereas
CapturedStmt already took care of all of those.  In theory `__finally`
could also be moved over to CapturedStmt, which would remove some
existing limitations (e.g. the inability to capture this), although
CaptureFinder would still be needed for SEH filters.

The one case supported by `@finally` but not CapturedStmt (or
CaptureFinder for that matter) is arbitrary control flow out of the
`@finally`, e.g. having a return statement inside a `@finally`. We can
add that support as a follow-up, but in practice we've found it to be
used very rarely anyway.

Differential Revision: https://reviews.llvm.org/D47564

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334251 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-08 00:30:00 +00:00
..
blockcast3.mm Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
blockstruct.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
crash.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
finally.m Consolidate header inclusion diagnostics 2014-07-11 20:53:51 +00:00
func-in-impl.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
id-test-3.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
inner-block-helper-funcs.mm Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
instancetype-test.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
ivar-encoding-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
ivar-encoding-2.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
line-generation-test.m Stop messing with the 'g' group of options in CompilerInvocation. 2015-10-08 04:24:12 +00:00
lit.local.cfg [test] Port clang tests to canonicalized booleans 2017-01-25 13:11:45 +00:00
metadata-test-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
metadata-test-2.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
method-encoding-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
missing-dllimport.c __declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension. 2015-05-26 19:44:52 +00:00
modern-write-bf-abi.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
no-integrated-preprocessing-64bit.m Correct test to target 'unknown' 2013-12-02 03:50:16 +00:00
no-integrated-preprocessing.m Use -target instead of ignored -arch to fix x86_64 builders 2014-02-16 08:18:13 +00:00
objc-bool-literal-check-modern.mm objective-c modern translator: buildit objc bool 2012-04-16 21:03:30 +00:00
objc-bool-literal-modern-1.mm modern objc translator: used size_t in couple 2012-05-03 21:44:12 +00:00
objc-bool-literal-modern.mm objective-c modern translator: buildit objc bool 2012-04-16 21:03:30 +00:00
objc-encoding-bug-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
objc-ivar-receiver-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
objc-modern-StretAPI-2.mm Modern objc translator: Fixes a crash in rewriter when rewriting the API 2012-08-21 18:56:50 +00:00
objc-modern-StretAPI-3.mm Modern ObjectiveC translator. Fix translation of 2013-09-09 19:59:59 +00:00
objc-modern-StretAPI.mm objective-c modern translator: synthesize argument type 2012-06-29 19:55:46 +00:00
objc-modern-boxing.mm [Objective-C modern translation]. Patch to fix type of 2015-04-09 18:36:50 +00:00
objc-modern-class-init-hooks.mm objective-c modern translator: move all inithooks into a single array 2012-03-27 18:41:05 +00:00
objc-modern-class-init.mm modern objective-c translator: add static function to initialize 2012-03-20 21:41:28 +00:00
objc-modern-container-subscript.mm Remove dependency on string.h 2012-06-29 23:48:43 +00:00
objc-modern-fast-enumeration.mm ObjectiveC modern translator: fix up generated fast enumeration 2013-09-05 17:17:32 +00:00
objc-modern-getclass-proto.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
objc-modern-implicit-cast.mm modern objective-c translator: translation of implicit 2012-04-16 22:14:01 +00:00
objc-modern-ivar-receiver-1.mm Commit patch reverted in r153454 with the modified test 2012-03-27 16:21:30 +00:00
objc-modern-linkage-spec.mm modern objective-c translator: rewriter linkage spec. 2012-04-03 17:35:38 +00:00
objc-modern-metadata-visibility.mm modern objc translator: additional test. 2012-03-29 18:20:51 +00:00
objc-modern-numeric-literal.mm [Objective-C modern translation]. Patch to fix type of 2015-04-09 18:36:50 +00:00
objc-modern-property-attributes.mm Objective-C: Correctly encode 'retain' and 'copy' for readonly properties. 2013-05-08 23:47:40 +00:00
objc-modern-property-bitfield.m Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
objc-string-concat-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
objc-super-test.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
objc-synchronized-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
properties.m Give some obj-c rewriter tests that use MS pragmas a triple as a speculative fix 2015-03-05 00:04:18 +00:00
property-dot-syntax.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
protocol-rewrite-1.m ObjectiveC modern translator. Fixes a translation bug 2013-11-22 18:43:41 +00:00
protocol-rewrite-2.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-anonymous-union.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-api-bug.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-block-argument.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-block-consts.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-block-ivar-call.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-block-literal-1.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-block-literal.mm Objective-C modern rewriter. Patch to fix a rewriting bug 2014-10-28 23:46:58 +00:00
rewrite-block-pointer.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-block-property.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-byref-in-nested-blocks.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-byref-vars.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-captured-nested-bvar.c Add a bunch of missing "CHECK" colons in tests. NFC. 2015-03-14 01:10:19 +00:00
rewrite-cast-ivar-access.mm Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
rewrite-cast-ivar-modern-access.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-cast-to-bool.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-category-property.mm Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
rewrite-constructor-init.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-eh.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-elaborated-type.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-extern-c.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-foreach-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-foreach-2.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-foreach-3.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-foreach-4.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-foreach-5.m Define id to the correct type. 2013-06-07 18:41:01 +00:00
rewrite-foreach-6.m Define id to the correct type. 2013-06-07 18:41:01 +00:00
rewrite-foreach-7.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-foreach-in-block.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-foreach-protocol-id.m Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-forward-class.m Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-forward-class.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-function-decl.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-implementation.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-interface-locals.mm ObjectiveC modern rewriter. Rewrite typedefs 2013-10-07 19:54:22 +00:00
rewrite-ivar-use.m Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-line-directive.m Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
rewrite-local-externs-in-block.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-local-static-id.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-message-expr.mm Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
rewrite-modern-array-literal.mm [Objective-C modern translation]. Patch to fix type of 2015-04-09 18:36:50 +00:00
rewrite-modern-atautoreleasepool.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-block-consts.mm modern objc translator: used size_t in couple 2012-05-03 21:44:12 +00:00
rewrite-modern-block-ivar-call.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-block.mm Objective-C modern rewriter. Patch to fix a rewriting bug 2014-10-28 23:46:58 +00:00
rewrite-modern-captured-nested-bvar.mm Add a bunch of missing "CHECK" colons in tests. NFC. 2015-03-14 01:10:19 +00:00
rewrite-modern-catch.m modern objective-c translator: rewriting of @catch-stmt. 2012-03-15 20:11:10 +00:00
rewrite-modern-class.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-container-literal.mm [Objective-C modern translation]. Patch to fix type of 2015-04-09 18:36:50 +00:00
rewrite-modern-default-property-synthesis.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-extern-c-func-decl.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-ivar-access.mm clang/test/Rewriter: Remove XFAIL and add -U__declspec to other 9 tests. mingw32 tends to define built-in __declspec. 2012-05-01 10:52:06 +00:00
rewrite-modern-ivar-use.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-ivars-1.mm clang/test/Rewriter: Remove XFAIL and add -U__declspec to other 9 tests. mingw32 tends to define built-in __declspec. 2012-05-01 10:52:06 +00:00
rewrite-modern-ivars-2.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-ivars.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-nested-ivar.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-private-ivars.mm modern objective-c translation of private ivars. 2012-05-01 17:46:45 +00:00
rewrite-modern-protocol-1.mm objective-c modern translator: Make metadata 2012-04-14 17:13:08 +00:00
rewrite-modern-protocol.mm modern objc translator. Finish off first cut of the 2012-02-20 20:09:20 +00:00
rewrite-modern-qualified-type.mm Objective-C modern rewriter. Fixes a bug 2013-04-03 19:11:21 +00:00
rewrite-modern-struct-ivar-1.mm Modern objective-c translation: Fixing couple of bugs 2012-05-02 17:34:59 +00:00
rewrite-modern-struct-ivar.mm clang/test/Rewriter: Remove XFAIL and add -U__declspec to other 9 tests. mingw32 tends to define built-in __declspec. 2012-05-01 10:52:06 +00:00
rewrite-modern-super.mm modern objective-c translator: When translating 2012-04-13 16:20:05 +00:00
rewrite-modern-synchronized.m ObjectiveC modern translator: Provide proper cast of 2013-09-17 17:51:48 +00:00
rewrite-modern-throw.m Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-modern-try-catch-finally.m modern objective-c translator: fix type of objc_exception_throw 2012-03-19 18:11:32 +00:00
rewrite-modern-try-finally.m Reapply "[Parse] Use CapturedStmt for @finally on MSVC" 2018-06-08 00:30:00 +00:00
rewrite-modern-typeof.mm Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
rewrite-nest.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-nested-blocks-1.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-nested-blocks-2.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-nested-blocks.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-nested-ivar.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-nested-property-in-blocks.mm Give some obj-c rewriter tests that use MS pragmas a triple as a speculative fix 2015-03-05 00:04:18 +00:00
rewrite-no-nextline.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-property-attributes.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-property-set-cfstring.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-protocol-property.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-protocol-qualified.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-protocol-type-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-qualified-id.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-rewritten-initializer.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-static-block.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-super-message.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-trivial-constructor.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-try-catch.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-typeof.mm Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
rewrite-unique-block-api.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
rewrite-user-defined-accessors.mm Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-vararg.m Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
rewrite-weak-attr.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
static-type-protocol-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
undecl-objc-h.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
undeclared-method-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
undef-field-reference-1.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
unnamed-bf-modern-write.mm objective-C modern translator. Fix up the translated 2013-02-07 01:53:15 +00:00
va-method.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
weak_byref_objects.m Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00