summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/cpp11-migrate/UseAuto
Commit message (Collapse)AuthorAgeFilesLines
* Rename cpp11-migrate to clang-modernize.Chandler Carruth2013-09-045-553/+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
* Fix UseAuto not transforming iterator when non-fully qualifiers are used andAriel J. Bernal2013-07-153-5/+10
| | | | | | | | | | | | using inline namespaces is specified. UseAuto used to fail to transform iterators when using inline namespaces and non-fully qualified types, relying on a using directive previously declared. - This fix uses the already define isFromStdNamespace matcher. - Fixed tests and added a new test using inline namespaces. - Added CustomMatchers to reuse common matchers among transforms. llvm-svn: 186327
* Fix UseAuto replacing declaration lists with new expressionsAriel J. Bernal2013-05-271-0/+45
| | | | | | | | | | | UseAuto used to replace declarion lists with new expressons where some variable were not initialized with new. This fix checks that every DeclStmt has a VarDecl with an initializer and it also ensures that all declarations have the same type. Added tests for multiple declarations and for typedefs. llvm-svn: 182736
* Fix UseAuto replacing variable declaration lists containing non-initializedAriel J. Bernal2013-05-171-0/+12
| | | | | | | | | | | variables. UseAuto used to match initialized variable declarations independently of whether they were defined in a declaration list or as a single declaration. Now it matches declaration statements where every variable declaration is initialized. llvm-svn: 182114
* Use 'auto' with 'new' expressionsEdwin Vane2013-04-022-0/+88
| | | | | | | | | | | | | | | | | | | | | For variable declarations initialized with new expressions, use 'auto' for the type specifier. The 'auto' replacement happens only when the type of the VarDecl exactly matches the type of the initializer and the VarDecl is *not* CV-qualified. The only case that is currently handled is if the pointer type of the VarDecl is itself CV qualified. Some improvements need to be made to Clang's TypeLoc information in order for other CV qualifier cases to be successfully handled. See the new test suite new_cv_failing.cpp for examples of usages that could be handled with such an improvement. Function pointers are, for now, not transformed until the identifier info can be extracted. Reviewer: klimek llvm-svn: 178575
* cpp11-migrate segfaults transforming map<string,int>::iterator Ariel J. Bernal2013-03-272-0/+11
| | | | | | | | | | | | cpp11-migrate segfaults when -use-auto tries to resolve initializing expression resulting in an expression with cleanups. - Skip expressions with cleanups from the initializer - Added test case Fixes PR15550 llvm-svn: 178167
* Switch from autogenerating tests to using the preprocessor.Chandler Carruth2013-03-075-258/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: You may need to run 'make clean' or 'ninja -t clean' etc!!! This is due to really nasty bug/interactions between CMake/configure/make/Ninja/LIT... This commit tries to back out the support for generating test cases as part of the build system due to the issues I brought up in post-commit review: 1) It adds a *lot* of complexity and fragility to the build system. See the number of commits required to try to get all the bots happy. 2) It isn't really necessary -- we can already run scripts to generate things with the RUN lines of a test. 3) It makes the tests somewhat harder to debug as they cross between more domains. 4) In almost all cases it isn't really needed or it can be done directly using the preprocessor. I should have been more proactive reviewing this, and I'm really sorry about the churn here. =/ To help keep track of what commits are going where, this backs out most of the non-test-changes from these revisions: r176397 r176373 r176293 r176184 r175744 r175624 r175545 r175544 There were several trivial or cleanup changes to the lit files or other files. Some of these looked ok, but I didn't try to tease them apart... Edwin, if you know what to look for, please carry on with the cleanups there, and sorry for hosing stuff here but I'm not much of a Python person, and so I was erring on the side of cautiously backing out the change. I've tried to preserve the test changes everywhere I could, but review is appreciated here in case I missed some. I then re-wrote the tests to use the preprocessor rather than python to expand to the various bits of code. The nicest part of this is that now all the files are just C++ code. They edit and behave like C++ code, etc. RUN lines with different -D flags are used to run the same test over multiple different configurations, and includes bracketed in special defines are used to flesh out a collection of standard interface stubs to test interactions between pieces. These probably aren't perfect yet, but I think its an improvement (at least in terms of build system complexity) and will hopefully be a useful demonstration of the technique I prefer for these types of tests. llvm-svn: 176627
* Make gen_my_std.h.py compatible with python 2.5 too.Benjamin Kramer2013-03-021-23/+23
| | | | llvm-svn: 176409
* Make the UseAuto test case generator compatible with python 2.5.Benjamin Kramer2013-03-021-16/+16
| | | | llvm-svn: 176406
* Fix recursive make in clang-tools-extraEdwin Vane2013-03-011-2/+2
| | | | | | | | | | | | | | Autoconf make (all) now properly recurses from tools/extra/Makefile into tools/extra/test/Makefile and tools/extra/test/cpp11-migrate/Makefile. The 'all' target is responsible for creating lit config files and autogenerating tests. Subsequent 'check-all' targets will properly work. Re-enabling UseAuto/iterator.cpp test. General clean-up of clang-tools-extra makefiles; removing dead targets and removing duplicated pieces of llvm/Makefile.rules. llvm-svn: 176373
* Don't use 'exit' in lit scriptEdwin Vane2013-02-281-4/+1
| | | | | | | | Some buildbots use a shell that doesn't know 'exit'. So instead of using XFAIL for UseAuto/iterator.cpp (since this problem doesn't exist for cmake) leave the 'grep' command and turn off the others. llvm-svn: 176295
* Turning off UseAuto/iterator.cpp test until recursive make issue fixedEdwin Vane2013-02-281-3/+6
| | | | | | | | | The way 'make check-all' causes configuration files to be generated results in the cpp11-migrate/Makefile not being triggered to generated any files. These files are necessary for UseAuto/iterator.cpp to run. Turning off this test until the problem is fixed properly. llvm-svn: 176293
* Introducing Use-Auto transform for cpp11-migrateEdwin Vane2013-02-283-44/+286
| | | | | | | | | | | The new Use-Auto transform replaces the type specifier for variable declarations with the special C++11 'auto' type specifier. For now, the replacement is done only for variables that are iterators of any of the std containers and only if the type used is one of those explicitly allowed by the standard (i.e. not an implementation-specific type). Reviewers: gribozavr, silvas, klimek llvm-svn: 176266
* Adding files left out of commit r175544.Edwin Vane2013-02-192-0/+153
llvm-svn: 175545
OpenPOWER on IntegriCloud