summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/RefactoringActionRulesTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unittests misc. typos Sylvestre Ledru2018-02-061-1/+1
| | | | | | By luz.paz llvm-svn: 324342
* [refactor] Describe refactorings in the operation classesAlex Lorenz2017-10-271-1/+27
| | | | | | | | | | | | | | | | | This commit changes the way that the refactoring operation classes are structured: - Users have to call `initiate` instead of constructing an instance of the class. The `initiate` is now supposed to have custom initiation logic, and you don't need to subclass the builtin requirements. - A new `describe` function returns a structure with the id, title and the description of the refactoring operation. The refactoring action classes are now placed into one common place in RefactoringActions.cpp instead of being separate. Differential Revision: https://reviews.llvm.org/D38985 llvm-svn: 316780
* [refactor] allow the use of refactoring diagnosticsAlex Lorenz2017-10-161-6/+7
| | | | | | | | | This commit allows the refactoring library to use its own set of refactoring-specific diagnostics to reports things like initiation errors. Differential Revision: https://reviews.llvm.org/D38772 llvm-svn: 315924
* Add std::move in RefactoringActionRulesTest.cppAlex Lorenz2017-10-021-1/+1
| | | | | | Should fix http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental llvm-svn: 314708
* [refactor] Simplify the refactoring interfaceAlex Lorenz2017-10-021-72/+57
| | | | | | | | | | | | | This commit simplifies the interface for the refactoring action rules and the refactoring requirements. It merges the selection constraints and the selection requirements into one class. The refactoring actions rules must now be implemented using subclassing instead of raw function / lambda pointers. This change also removes a bunch of template-based traits and other template definitions that are now redundant. Differential Revision: https://reviews.llvm.org/D37681 llvm-svn: 314704
* [refactor] add clang-refactor tool with initial testing support andAlex Lorenz2017-09-141-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | local-rename action This commit introduces the clang-refactor tool alongside the local-rename action which uses the existing renaming engine used by clang-rename. The tool doesn't actually perform the source transformations yet, it just provides testing support. This commit also moves only one test from clang-rename over to test/Refactor. I will continue to move the other tests throughout development of clang-refactor. The following options are supported by clang-refactor: -v: use verbose output -selection: The source range that corresponds to the portion of the source that's selected (currently only special command test:<file> is supported). Please note that a follow-up commit will migrate clang-refactor to libTooling's common option parser, so clang-refactor will be able to use the common interface with compilation database and options like -p, -extra-arg, etc. The testing support provided by clang-refactor is described below: When -selection=test:<file> is given, clang-refactor will parse the selection commands from that file. The selection commands are grouped and the specified refactoring action invoked by the tool. Each command in a group is expected to produce an identical result. The precise syntax for the selection commands is described in a comment in TestSupport.h. Differential Revision: https://reviews.llvm.org/D36574 llvm-svn: 313244
* Fix GCC build error and warnings from r313025Alex Lorenz2017-09-121-1/+7
| | | | llvm-svn: 313027
* [refactor] add a refactoring action rule that returns symbol occurrencesAlex Lorenz2017-09-121-0/+46
| | | | | | Differential Revision: https://reviews.llvm.org/D36574 llvm-svn: 313025
* [refactor] Use a RefactoringResultConsumer instead of tagged refactoringAlex Lorenz2017-09-011-16/+29
| | | | | | | | | | | | | rule classes This commit changes the way that the refactoring results are produced. Instead of using different `RefactoringActionRule` subclasses for each result type, Clang now use a single `RefactoringResultConsumer`. This was suggested by Manuel in https://reviews.llvm.org/D36075. Differential Revision: https://reviews.llvm.org/D37291 llvm-svn: 312316
* Avoid missing std error code in RefactoringActionRulesTest.cppAlex Lorenz2017-08-281-2/+2
| | | | | | | This should fix this bot: http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux llvm-svn: 311886
* [refactor] initial support for refactoring action rulesAlex Lorenz2017-08-281-0/+165
This patch implements the initial support for refactoring action rules. The first rule that's supported is a "source change" rule that returns a set of atomic changes. This patch is based on the ideas presented in my RFC: http://lists.llvm.org/pipermail/cfe-dev/2017-July/054831.html The following pieces from the RFC are added by this patch: - `createRefactoringRule` (known as `apply` in the RFC) - `requiredSelection` refactoring action rule requirement. - `selection::SourceSelectionRange` selection constraint. Differential Revision: https://reviews.llvm.org/D36075 llvm-svn: 311884
OpenPOWER on IntegriCloud