summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/cpp11-migrate/LoopConvert
Commit message (Collapse)AuthorAgeFilesLines
* Rename cpp11-migrate to clang-modernize.Chandler Carruth2013-09-0420-1824/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | There is no reason to expect this tool to be limited to C++11, it seems very likely to be of on-going interest. It seems likely to be useful for modernizing even as new libraries come out in TSes and other formats than a complete standard. Fundamentally, we need something a bit more general. After some discussion on the list, going with 'clang-modernize'. I've tried to do a reasonably comprehensive job of fixing up the names, but I may still have missed some. Feel free to poke me if you spot any fallout here. Things I've tried reasonably hard to find and fix: - cpp11-migrate -> clang-modernize - Migrator -> Modernizer - Clean up the introductory documentation that was C++11 specific. I'll also point out that this tool continues to delight me. =] Also, a huge thanks to those who have so carefully, thoroughly documented the tool. The docs here are simply phenomenal. Every tool should be this well documented. I hope I have updated the documentation reasonably well, but I'm not very good at documentation, so review much appreciated. llvm-svn: 189960
* Update tests to reflect clang r189769 which changes the printing ofChandler Carruth2013-09-024-6/+6
| | | | | | 'auto const' to 'const auto'. llvm-svn: 189770
* Transform for loops over pseudo-arrays only if begin/end members existEdwin Vane2013-05-092-1/+72
| | | | | | | | | | | | For loops using pseudo-arrays, classes that can be used like arrays from the Loop Convert Transform's point of view, should only get transformed if the pseudo-array class has begin()/end() members for the range-based for-loop to call. Free versions of begin()/end() should also be allowed but this is an enhancement for another revision. llvm-svn: 181539
* Use 'auto const&' for iterators whose deref operator return a const varAriel J. Bernal2013-05-095-15/+115
| | | | | | | | | This patch fixes PR15601. - Added check for whether the loop variable and the initializer have the same type. - Added tests. llvm-svn: 181528
* Stop LoopConvert removing DeclStmts from selection/iteration condition clausesEdwin Vane2013-05-061-0/+43
| | | | | | | | | | | If the LoopConvert Transform detects an alias for the loop variable, it attempts to use that name in the resulting range-based for loop while removing the original DeclStmt for the variable. That removal produced bad code when the declaration was in the condition of an if, switch, while, or for stmt. This revision fixes the problem by simply replacing the declaration with a use of the alias variable. llvm-svn: 181242
* Improve loop convert's variable aliasingEdwin Vane2013-04-011-0/+37
| | | | | | | | | | | | | | | Loop convert's variable name aliasing may cause issues if the variable is declared as a value (copy). The converted loop will declare the variable as a reference which may inadvertently cause modifications to the container if it were used and modified as a temporary copy. This is fixed by preserving the reference or value qualifiers of the aliased variable. That is, if the variable was declared as a value the loop variable will also be declared as a value and similarly for references. Fixes: PR15600 Author: Jack Yang <jack.yang@intel.com> llvm-svn: 178485
* Adding a failing test case for cpp11-migrate's Loop Convert TransformEdwin Vane2013-03-252-0/+29
| | | | | | Related to PR15589. llvm-svn: 177891
* Extend loop variable naming checksEdwin Vane2013-03-089-151/+254
| | | | | | | | | | | | The loop convert tests for conflicting names have been extended to check for macro names, types, and language keywords including language extensions. Tests have also been added. Fixes PR15322 Author: Jack Yang <jack.yang@intel.com> Reviewer: gribozavr, klimek, revane llvm-svn: 176690
* Have LoopConvert use 'auto &&' where necessaryEdwin Vane2013-03-073-15/+55
| | | | | | | | | | | | | | | | For iterators where the dereference operator returns by value, LoopConvert should use 'auto &&' in the range-based for loop expression. If the dereference operator returns an rvalue reference, this is deemed too strange and the for loop is not converted. Moved test case from iterator_failing.cpp to iterator.cpp and added extra tests. Fixes PR15437. Reviewer: gribozavr llvm-svn: 176631
* Adding failing LoopConvert testcaseEdwin Vane2013-03-042-0/+27
| | | | | | | | | LoopConvert isn't properly handling iterators whose dereference operator returns by value. This test case demonstrates the failure. See PR15437. llvm-svn: 176437
* Properly identify 'this' as range-based for containerEdwin Vane2013-03-041-1/+71
| | | | | | | | | The Loop-Convert transform was mistransforming loops using 'this' implicitly. Fixed and added tests. Fixes PR15411. llvm-svn: 176436
* Transferred loop-convert tests to cpp11-migrateEdwin Vane2013-01-0816-0/+1304
- Turned off -count-only tests as they aren't supported in cpp11-migrate yet. - Updated tests to use new binary name and options to access loop-convert transform. - Fixed header guards to not use restricted names. Reviewers: klimek, gribozavr llvm-svn: 171852
OpenPOWER on IntegriCloud