summaryrefslogtreecommitdiffstats
path: root/clang/test/Rewriter
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
* [clang] Remove unit test which uses reverse-iterate flagMandeep Singh Grang2017-08-241-45/+0
| | | | | | | | | | | | | | Summary: This patch is in response to https://reviews.llvm.org/D35043 which removed -reverse-iterate flag. Reviewers: dblaikie, mehdi_amini Reviewed By: dblaikie Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D36386 llvm-svn: 311720
* [Objective-C] Fix non-determinism in clangMandeep Singh Grang2017-07-061-0/+45
| | | | | | | | | | | | | | Summary: Iteration of the unordered Ivars causes objc-modern-metadata-visibility.mm (uncovered by reverse iterating SmallPtrSet). Reviewers: dblaikie, davide, rsmith Reviewed By: dblaikie Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D34860 llvm-svn: 307296
* [test] Port clang tests to canonicalized booleansMichal Gorny2017-01-251-1/+1
| | | | | | | | | | | Use the new llvm_canonicalize_cmake_booleans() function to canonicalize booleans for lit tests. Replace the duplicate ENABLE_CLANG* variables used to hold canonicalized values with in-place canonicalization. Use implicit logic in Python code to avoid overrelying on exact 0/1 values. Differential Revision: https://reviews.llvm.org/D28529 llvm-svn: 293052
* Specify -std=gnu++98 on some Rewriter tests. NFC.Paul Robinson2016-12-0932-40/+40
| | | | | | | | | Rewriter tests rewrite Objective-C++ to C++, and then compile the result. The rewritten result sometimes doesn't work with C++11. As we want to allow Clang's default dialect to become C++11, we need to make sure the tests will still pass. llvm-svn: 289167
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-1/+1
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* __declspec is not a core Clang language extension. Instead, require ↵Aaron Ballman2015-05-261-1/+1
| | | | | | | -fms-extensions or -fborland to enable the language extension. Note: __declspec is also temporarily enabled when compiling for a CUDA target because there are implementation details relying on __declspec(property) support currently. When those details change, __declspec should be disabled for CUDA targets. llvm-svn: 238238
* [Objective-C modern translation]. Patch to fix type ofFariborz Jahanian2015-04-094-22/+22
| | | | | | | objc_msgSend's first argument to "Class" because objc_getClass is passed. rdar://20477025 llvm-svn: 234520
* Add a bunch of missing "CHECK" colons in tests. NFC.Ahmed Bougacha2015-03-142-2/+2
| | | | llvm-svn: 232237
* Give some obj-c rewriter tests that use MS pragmas a triple as a speculative fixReid Kleckner2015-03-052-6/+6
| | | | llvm-svn: 231320
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-0/+0
| | | | llvm-svn: 230783
* Objective-C modern rewriter. Patch to fix a rewriting bug Fariborz Jahanian2014-10-283-2/+5
| | | | | | | rewriting an Objective-C block. Patch by Ryan Govostes. rdar://18799145 llvm-svn: 220834
* Make clang's rewrite engine a core featureAlp Toker2014-07-161-1/+2
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
* Consolidate header inclusion diagnosticsAlp Toker2014-07-111-1/+1
| | | | | | | Make argument orders match, unify diagnostic IDs and reword the message to be a little less saccharine. llvm-svn: 212845
* Don't suppress warning about dllimport on typedefs etc. in MicrosoftExt modeHans Wennborg2014-05-231-17/+0
| | | | | | | | | | | | | | | | | It's true the MSVC doesn't warn about dllimport when applied to e.g. a typedef, but that applies to dllexport too. I'd like us to be consistent, and I think the right thing to do is to warn. The original test that came with implementing the old behaviour doesn't provide a good motivation, and it said it was checking that we're not repoting an *error*, which is still true since this is just a warning. There are plenty of tests e.g. in Sema/dllimport.c to check that we do warn about dllimport on non functions or variables. Differential Revision: http://reviews.llvm.org/D3832 llvm-svn: 209546
* An inline function redeclaration does not drop the dllimport attributeHans Wennborg2014-05-221-14/+3
| | | | llvm-svn: 209449
* Reorganize and improve semantic tests for dllexport/importNico Rieck2014-02-221-1/+1
| | | | llvm-svn: 201947
* Use -target instead of ignored -arch to fix x86_64 buildersNico Rieck2014-02-161-1/+1
| | | | llvm-svn: 201480
* Fix broken CHECK linesNico Rieck2014-02-161-1/+1
| | | | llvm-svn: 201477
* Teach the diagnostics engine about the Attr type to make reporting on ↵Aaron Ballman2013-12-261-1/+1
| | | | | | semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting. llvm-svn: 198055
* Correct test to target 'unknown'Alp Toker2013-12-021-1/+1
| | | | llvm-svn: 196060
* ObjectiveC modern translator. Fixes a translation bugFariborz Jahanian2013-11-221-1/+26
| | | | | | tranalation @protocol expression. // rdar://15517895 llvm-svn: 195480
* ObjectiveC modern rewriter. Rewrite typedefsFariborz Jahanian2013-10-071-0/+20
| | | | | | | declared locally in ObjectiveC containers. // rdar://15143875 llvm-svn: 192127
* Replace -fobjc-default-synthesize-properties with ↵Rafael Espindola2013-09-271-1/+1
| | | | | | | | | disable-objc-default-synthesize-properties. We want the modern behavior most of the time, so inverting the option simplifies the driver and the tests. llvm-svn: 191551
* Revert my patch in r191155 to allow forwardFariborz Jahanian2013-09-241-1/+12
| | | | | | | | class/protocol decls in @implementation and fixup modern rewriter to handle that. // rdar://15066233 llvm-svn: 191311
* ObjectiveC modern translator: Provide proper cast ofFariborz Jahanian2013-09-171-2/+13
| | | | | | | the ObjectiveC object of an @synchronized statement. // rdar://14993814 llvm-svn: 190874
* Modern ObjectiveC translator. Fix translation of Fariborz Jahanian2013-09-091-0/+58
| | | | | | | | message sent to aggregate-valued methods. Fix visibility of trampoline type used in translation of such expressions. // rdar://14932320 llvm-svn: 190341
* ObjectiveC modern translator: fix up generated fast enumerationFariborz Jahanian2013-09-051-0/+25
| | | | | | | code to work for bit 32bit and 64bit APIs. // rdar://14913632 llvm-svn: 190072
* Adjust clang for change to APFloat::toString.Eli Friedman2013-08-292-4/+4
| | | | | | | | I changed the diagnostic printing code because it's probably better to cut off a digit from DBL_MAX than to print something like 1.300000001 when the user wrote 1.3. llvm-svn: 189625
* Make the information about disabled ARCMT/Rewriter/StaticAnalyzer availableRoman Divacky2013-08-271-0/+2
| | | | | | | to lit and use this info to disable Analysis/FixIt/Rewriter/Analysis tests when those are not compiled into clang. llvm-svn: 189395
* Fix FileCheck --check-prefix lines.Tim Northover2013-08-129-12/+12
| | | | | | | | | | Various tests had sprung up over the years which had --check-prefix=ABC on the RUN line, but "CHECK-ABC:" later on. This happened to work before, but was strictly incorrect. FileCheck is getting stricter soon though. Patch by Ron Ofir. llvm-svn: 188174
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-042-4/+4
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Define id to the correct type.Rafael Espindola2013-06-074-5/+5
| | | | | | | Found this while working on pr16247. The fix for that bug will cause clang to reject this. llvm-svn: 183545
* Objective-C: Correctly encode 'retain' and 'copy' for readonly properties.Nico Weber2013-05-081-0/+12
| | | | | | | | | | clang would omit 'C' for 'copy' properties and '&' for 'retain' properties if the property was also 'readonly'. Fix this, which makes clang match gcc4.2's behavior. Fixes PR15928. llvm-svn: 181491
* Fix PR15845: apparently MSVC does not support implicit int in C++ mode.Richard Smith2013-04-301-1/+1
| | | | llvm-svn: 180822
* Objective-C modern rewriter. Fixes a bugFariborz Jahanian2013-04-031-0/+11
| | | | | | | | rewriting typedef for a qualified object type and also when two declarations happen to be on the same line. // rdar://13562505 llvm-svn: 178680
* Objective-C modern translator. Don't put line infoFariborz Jahanian2013-03-181-0/+18
| | | | | | | | into the pre-preprocessed file to be passed to modern translator when compiling in no debug mode. // rdar://13138170 llvm-svn: 177311
* objective-C modern translator: Fixes a mistranslationFariborz Jahanian2013-02-111-0/+26
| | | | | | | of @throw statement by finding location of the ';' correctly. // rdar://13186010 llvm-svn: 174898
* objective-C modern translation: Fix another random translation bugFariborz Jahanian2013-02-081-0/+43
| | | | | | | involving property getter expressions on rhs of property setter. // rdar://13138459 llvm-svn: 174729
* objective-C modern translator. Fixes a trivialFariborz Jahanian2013-02-081-0/+20
| | | | | | | rewriting bug where #ifdef ended up on the same line as the attribute declaration. llvm-svn: 174719
* objective-C modern translator. Generate #lineFariborz Jahanian2013-02-081-0/+40
| | | | | | | info in the translated code under -g only. // rdar://13138170 llvm-svn: 174684
* objective-C modern translator. More fixups for Fariborz Jahanian2013-02-071-0/+48
| | | | | | | modern meta-data abi translation. Still wip. // rdar://13138459 llvm-svn: 174672
* objective-C modern translator. Fix up the translatedFariborz Jahanian2013-02-072-6/+62
| | | | | | | metadata to handle ivar bitfields. This is wip. // rdar://13138459 llvm-svn: 174573
* -arch is a darwin-specific driver feature, use a triple instead in rewriter ↵Benjamin Kramer2012-10-021-3/+1
| | | | | | test. llvm-svn: 164995
* Modern translator test. Breakup test into two andFariborz Jahanian2012-10-012-8/+28
| | | | | | skip the x86_64 version for mingw32 and win32. llvm-svn: 164977
* Rename a test I just added.Fariborz Jahanian2012-10-011-0/+0
| | | | llvm-svn: 164971
* objective-C modern translator. Test for producing bothFariborz Jahanian2012-10-011-0/+34
| | | | | | | 32bit and 64bit version of modern translator. // rdar://12189793 llvm-svn: 164970
* StmtPrinter: Print floating point literals with the right suffix to ↵Benjamin Kramer2012-09-202-2/+2
| | | | | | | | disambiguate them from integers. Based on a patch by Olaf Krzikalla, UDL fixes by me. llvm-svn: 164303
* Modern objc translator: Fixes a crash in rewriter when rewriting the APIFariborz Jahanian2012-08-211-0/+30
| | | | | | for structure valued method messaging. // rdar://12142241 llvm-svn: 162303
* Remove dependency on string.hFariborz Jahanian2012-06-291-1/+1
| | | | llvm-svn: 159475
OpenPOWER on IntegriCloud