summaryrefslogtreecommitdiffstats
path: root/clang/test/Refactor
Commit message (Collapse)AuthorAgeFilesLines
* [Tooling] Added DeclStmtClass to ExtractionSemicolonPolicyShaurya Gupta2019-08-141-1/+12
| | | | | | | Since the DeclStmt range includes the semicolon, it doesn't need a semicolon at the end during extraction llvm-svn: 368850
* [Extract] Fixed SemicolonExtractionPolicy for SwitchStmt and SwitchCaseShaurya Gupta2019-08-081-0/+13
| | | | | | | | | | | | Reviewers: arphaman, sammccall Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65883 llvm-svn: 368267
* [refactor][extract] avoid extracting expressions from types in functionsAlex Lorenz2017-11-141-2/+16
| | | | llvm-svn: 318169
* [clang-refactor] Introduce a new rename rule for qualified symbolsHaojian Wu2017-11-081-0/+24
| | | | | | | | | | | | | | Summary: Prototype of a new rename rule for renaming qualified symbol. Reviewers: arphaman, ioeric, sammccall Reviewed By: arphaman, sammccall Subscribers: jklaehn, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39332 llvm-svn: 317672
* [refactor] rename field references in __builtin_offsetofAlex Lorenz2017-11-071-0/+32
| | | | | | rdar://33875453 llvm-svn: 317599
* Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 botsAlex Lorenz2017-11-031-1/+1
| | | | llvm-svn: 317372
* [refactor][extract] insert semicolons into extracted/inserted codeAlex Lorenz2017-11-033-2/+250
| | | | | | | | | | | | | | | | | | when needed This commit implements the semicolon insertion logic into the extract refactoring. The following rules are used: - extracting expression: add terminating ';' to the extracted function. - extracting statements that don't require terminating ';' (e.g. switch): add terminating ';' to the callee. - extracting statements with ';': move (if possible) the original ';' from the callee and add terminating ';'. - otherwise, add ';' to both places. Differential Revision: https://reviews.llvm.org/D39441 llvm-svn: 317343
* [refactor][extract] code extracted from inline method should be placedAlex Lorenz2017-11-011-0/+42
| | | | | | in a function defined before the outer class llvm-svn: 317062
* [refactor][extract] prohibit extraction of ObjC property settersAlex Lorenz2017-11-011-0/+41
| | | | llvm-svn: 317056
* [refactor] Initial outline of implementation of "extract function" refactoringAlex Lorenz2017-10-244-5/+68
| | | | | | | | | | | | | | | | | | | This commit adds an initial, skeleton outline of the "extract function" refactoring. The extracted function doesn't capture variables / rewrite code yet, it just basically does a simple copy-paste. The following initiation rules are specified: - extraction can only be done for executable code in a function/method/block. This means that you can't extract a global variable initialize into a function right now. - simple literals and references are not extractable. This commit also adds support for full source ranges to clang-refactor's test mode. Differential Revision: https://reviews.llvm.org/D38982 llvm-svn: 316465
* [clang-refactor] Add "-Inplace" option to the commandline tool.Haojian Wu2017-10-201-7/+5
| | | | | | | | | | | | | | | | | Summary: Change clang-refactor default behavior to print the new code after refactoring (instead of editing the source files), which would make it easier to use and debug the refactoring action. Reviewers: arphaman, ioeric Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39092 llvm-svn: 316212
* [refactor] allow the use of refactoring diagnosticsAlex Lorenz2017-10-161-0/+8
| | | | | | | | | 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
* Recommit r315738 "[clang-refactor] Apply source replacements"Alex Lorenz2017-10-162-0/+26
| | | | | | | | | | | | | | | The fixed commit ensures that ParsedSourceRange works correctly with Windows paths. Original message: This commit actually brings clang-refactor to a usable state as it can now apply the refactoring changes to source files. The -selection option is now also fully supported. Differential Revision: https://reviews.llvm.org/D38402 llvm-svn: 315918
* Revert r315738Alex Lorenz2017-10-132-26/+0
| | | | | | | The ParsedSourceRange class does not work correctly on Windows with the ':' drive separators llvm-svn: 315774
* [clang-refactor] Apply source replacementsAlex Lorenz2017-10-132-0/+26
| | | | | | | | | | This commit actually brings clang-refactor to a usable state as it can now apply the refactoring changes to source files. The -selection option is now also fully supported. Differential Revision: https://reviews.llvm.org/D38402 llvm-svn: 315738
* Recommit r315087 "[refactor] add support for refactoring options"Alex Lorenz2017-10-132-7/+7
| | | | | | | | | | | | | | | | The recommit fixes a UB bug that occurred only on a small number of bots. Original message: This commit adds initial support for refactoring options. One can now use optional and required std::string options. This commit also adds a NewNameOption for the local-rename refactoring action to allow rename to work with custom names. Differential Revision: https://reviews.llvm.org/D37856 llvm-svn: 315661
* Revert r315087Alex Lorenz2017-10-062-7/+7
| | | | | | clang-refactor crashes on some bots after this commit llvm-svn: 315095
* [refactor] add support for refactoring optionsAlex Lorenz2017-10-062-7/+7
| | | | | | | | | | | | This commit adds initial support for refactoring options. One can now use optional and required std::string options. This commit also adds a NewNameOption for the local-rename refactoring action to allow rename to work with custom names. Differential Revision: https://reviews.llvm.org/D37856 llvm-svn: 315087
* Fix Refactor/tool-test-support.c test on Windows by avoidingAlex Lorenz2017-09-141-6/+6
| | | | | | the STDERR redirect llvm-svn: 313266
* [refactor] Use CommonOptionsParser in clang-refactorAlex Lorenz2017-09-143-10/+7
| | | | | | | | | This commit ensures that CommonOptionsParser works with subcommands. This allows clang-refactor to use the CommonOptionsParser. Differential Revision: https://reviews.llvm.org/D37618 llvm-svn: 313260
* [refactor] add clang-refactor tool with initial testing support andAlex Lorenz2017-09-143-0/+56
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
OpenPOWER on IntegriCloud