summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/RefactoringActionRulesTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [test] Delete trailing spaces from YAML testsFangrui Song2019-07-121-1/+1
| | | | llvm-svn: 365873
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Support] Teach YAMLIO about polymorphic typesScott Linder2018-11-141-2/+2
| | | | | | | | | | | | | | | | | | | | | Add support for "polymorphic" types to YAMLIO. PolymorphicTraits can dynamically switch between other traits (Scalar, Map, or Sequence). When inputting, the PolymorphicTraits type is told which type to become, and when outputting the PolymorphicTraits type is asked which type it currently is. Also add support for TaggedScalarTraits to allow dynamically differentiating between multiple scalar types using YAML tags. Serialize empty maps as "{}" and empty sequences as "[]", so that types are preserved when round-tripping PolymorphicTraits. This change has equivalent semantics, but may break e.g. tests which compare output verbatim. Differential Revision: https://reviews.llvm.org/D48144 llvm-svn: 346884
* 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