summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/objc-try-catch-1.m
Commit message (Collapse)AuthorAgeFilesLines
* Reapply "[Parse] Use CapturedStmt for @finally on MSVC"Shoaib Meenai2018-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 334251
* Make clang -cc1 disable Objective-C exceptions by default, and add a ↵Anders Carlsson2011-02-221-2/+2
| | | | | | | | -fobjc-exceptions flag to turn them on. Update all tests accordingly. llvm-svn: 126177
* Revert r114316, -Wunused-value enabled by default was intended.Argyrios Kyrtzidis2010-09-191-3/+5
| | | | llvm-svn: 114318
* Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.Argyrios Kyrtzidis2010-09-191-5/+3
| | | | llvm-svn: 114316
* Fix rdar://8139785 "implement warning on dead expression in comma operator"Argyrios Kyrtzidis2010-06-301-2/+4
| | | | | | | | | | As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g: x || test_logical_foo1(); emitted a bogus "expression result unused" for 'x'. llvm-svn: 107274
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-2/+2
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Make tests use the new clang cc1 flag.Fariborz Jahanian2009-12-141-2/+2
| | | | llvm-svn: 91300
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-1/+1
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* implement semantic analysis for @synchronized, fixing a crash on invalidChris Lattner2009-04-211-1/+4
| | | | | | rdar://6810940 - @synchronized has no sema checks llvm-svn: 69670
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-2/+2
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Turn warning into error. Minor incompatibility with GCC (for scalar types, ↵Steve Naroff2009-02-121-1/+1
| | | | | | GCC only produces a warning). llvm-svn: 64375
* Fix <rdar://problem/6206858> [sema] type check @throw statements.Steve Naroff2009-02-111-1/+1
| | | | | | Added a FIXME to handle 'rethrow' check. llvm-svn: 64308
* Merge function-return.c into function.cChris Lattner2008-12-181-1/+1
| | | | | | | Fix PR2790 by making a warning an EXTWARN instead of EXTENSION. Add a new EXTENSION warning for "return (some void expression);" llvm-svn: 61187
* Objective-C keywords are not always identifiers. Some are also C++ keywordsDouglas Gregor2008-12-011-2/+2
| | | | llvm-svn: 60373
* fix typoGabor Greif2008-05-231-3/+3
| | | | llvm-svn: 51479
* implement simple support for arbitrary token lookahead. Change the Chris Lattner2008-03-101-2/+5
| | | | | | | | objc @try parser to use it, fixing a FIXME. Update the objc-try-catch-1.m file to pass now that we get more reasonable errors. llvm-svn: 48129
* Fix Parser::ParseObjCTryStmt() to allow for trailing @-keyword ↵Steve Naroff2008-02-051-0/+10
| | | | | | | | statements/expressions. This bug fix is the result of not having 2-token lookahead to recognize specific @-keywords. llvm-svn: 46768
* - Use Tok.isObjCAtKeyword instead of ↵Chris Lattner2007-12-271-24/+38
| | | | | | | | | | | | Tok.getIdentifierInfo()->getObjCKeywordID(). The later fails if the token is not an identifier. - Replace tabs with spaces. - Various other cleanups. Patch by Nico Weber! llvm-svn: 45368
* this patch accomodates clattner's comments on expression processing in ↵Fariborz Jahanian2007-10-041-1/+3
| | | | | | @try-statement. llvm-svn: 42611
* Patch to parse objective-c's @try-statement and @throw-statement.Fariborz Jahanian2007-09-191-0/+36
llvm-svn: 42148
OpenPOWER on IntegriCloud