summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename cpp11-migrate to clang-modernize.Chandler Carruth2013-09-041-42/+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
* cpp11-migrate: Refactor for driver model of operationEdwin Vane2013-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-commit of r189691 and r189689 now with a proper autoconf fix. Massive simplification of how replacements and file overrides are handled by the migrator: * Sources and headers are all treated the same. * All replacements for a given translation unit are stored in the same TranslationUnitReplacements structure. * Change tracking is updated only from main file; no need for propagating "is tracking" flag around. * Transform base class no longer responsible for applying replacements. They are simply stored and main() looks after deduplication and application. * Renamed -yaml-only to -serialize-replacements. Same restrictions apply: Can only request one transform. New restriction: formatting cannot also be turned on since it's basically a transform. * If -serialize-replacements is requested, changes to files will not be applied on disk. * Changed behaviour of function generating names for serialized replacements: Only the main source file goes into the name of the file since a file may contain changes for multiple different files. * Updated HeaderReplacements LIT test for new serialization behaviour. * Replaced old test that ensures replacements are not serialized if -serialize-replacements is not provided. New version ensures changes are made directly to all files in the translation unit. * Updated unit tests. * Due to major simplification of structures in FileOverrides.h, the FileOverridesTest is quite a bit simpler now. llvm-svn: 189798
* Revert "cpp11-migrate: Fixing autoconf build after adding libclangReplace ↵Michael Gottesman2013-08-301-1/+1
| | | | | | | | | | | | | | | | | dependency" Revert "cpp11-migrate: Refactor for driver model of operation" This reverts commit r189691. This reverts commit r189689. This was breaking the phase 1 OS X build for ~2 hours. https://smooshbase.apple.com/buildbot-internal/builders/phase1%20-%20sanity/builds/9559 I reverted the latter commit since I think the latter depended on the former. llvm-svn: 189700
* cpp11-migrate: Refactor for driver model of operationEdwin Vane2013-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Massive simplification of how replacements and file overrides are handled by the migrator: * Sources and headers are all treated the same. * All replacements for a given translation unit are stored in the same TranslationUnitReplacements structure. * Change tracking is updated only from main file; no need for propagating "is tracking" flag around. * Transform base class no longer responsible for applying replacements. They are simply stored and main() looks after deduplication and application. * Renamed -yaml-only to -serialize-replacements. Same restrictions apply: Can only request one transform. New restriction: formatting cannot also be turned on since it's basically a transform. * If -serialize-replacements is requested, changes to files will not be applied on disk. * Changed behaviour of function generating names for serialized replacements: Only the main source file goes into the name of the file since a file may contain changes for multiple different files. * Updated HeaderReplacements LIT test for new serialization behaviour. * Replaced old test that ensures replacements are not serialized if -serialize-replacements is not provided. New version ensures changes are made directly to all files in the translation unit. * Updated unit tests. * Due to major simplification of structures in FileOverrides.h, the FileOverridesTest is quite a bit simpler now. Differential Revision: http://llvm-reviews.chandlerc.com/D1545 llvm-svn: 189689
* cpp11-migrate: Tidying upEdwin Vane2013-07-081-3/+4
| | | | | | | | | | | | * Some file headers were missing for files in Core/ * Some headers were included but not necessary * CMakeLists.txt was linking in LLVMSupport even though CMakeLists in subdirs were linking it in too. * StringRefisation of constructors of types in FileOverrides.h * Other misc cleanups Author: Guillaume Papin <guillaume.papin@epitech.eu> llvm-svn: 185811
* cpp11-migrate: Transform now responsible for applying replacementsEdwin Vane2013-06-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | To make it possible for replacements made to headers as part of transforming one translation unit to not be visible to the transform of other translation units, Transform now handles replacement application as part of its end-of-source handling. Several things were simplified as a result: - The duplicated code in every transform for applying replacements is now gone and replaced with one location in Transform. - RefactoringTool is no longer used since Transform houses the Replacements structure. - RewriterContainer is now a private implementation detail of Transform (also renamed to RewriterManager since its behaviour is slightly different now with respect to lifetime of objects). - There's now no distinction between input and output file state. Misc notes: - Interface changes reflected in unit tests. - Replacements for files other than the main file are assumed to be for headers and stored as such. llvm-svn: 184194
* cpp11-migrate: Replace file override containerEdwin Vane2013-06-131-2/+2
| | | | | | | | | | | | A more flexible container for storing overrides is required for headers. Before a source goes through the transform pipeline, any headers it references will be in their original state and unaffected by transforms applied to other sources. Therefore overrides for headers need to be kept separate for each source file. This patch doesn't introduce support for storing header overrides yet. It only replaces the existing structure and makes any necessary changes to support it. llvm-svn: 183910
* cpp11-migrate: Refactor how global options are passed to TransformsEdwin Vane2013-06-061-2/+1
| | | | | | | | | Refactored how global options are passed to Transforms to avoid widespread changes every time a new global option is added. Tests updated to reflect new interface. llvm-svn: 183443
* cpp11-migrate: Transforms collect timing data.Edwin Vane2013-05-301-1/+1
| | | | | | | | | | Using updated form of newFrontendActionFactory(), Transforms now automatically measure, if requested, how long it takes to apply a MatchFinder to a source file. Other per-transform overhead, e.g. applying replacements, is not currently measured. This behaviour is disabled for now and soon will be connected to a new command line arg. llvm-svn: 182942
* lib-ified core cpp11-migrate functionality to support unit testsEdwin Vane2013-04-041-1/+1
| | | | | | | | | | | | | | | | | | Summary: Transform.* and Transforms.* moved to form a new library: libmigrateCore. #includes updated to point to new header locations. To support autoconf build, Cpp11Migrate.cpp moved to new subdirectory 'tool' which also contains build files for creating final binary. CMake and autoconf updated to build the new library and link it with cpp11-migrate and with cpp11-migrate unit tests. Dummy unit tests replaced with simple, but real, tests for Transform's public interface. TODO: Lib-ifying the transforms to further simplify build of cpp11-migrate. llvm-svn: 178785
* Added summary option to cpp11-migrate toolDmitri Gribenko2013-03-051-0/+2
| | | | | | | | | Added a summary option that enables output to stdout counting the number of changes each transform has accepted, rejected or deferred. Patch by Ariel Bernal. llvm-svn: 176465
* Introducing Use-Auto transform for cpp11-migrateEdwin Vane2013-02-281-0/+40
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
OpenPOWER on IntegriCloud