summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Refactoring/Extract.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move Extract.cpp that wasn't moved in r317343Alex Lorenz2017-11-031-199/+0
| | | | llvm-svn: 317344
* [refactor][extract] insert semicolons into extracted/inserted codeAlex Lorenz2017-11-031-3/+7
| | | | | | | | | | | | | | | | | | 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-2/+7
| | | | | | in a function defined before the outer class llvm-svn: 317062
* [refactor][extract] prohibit extraction of ObjC property settersAlex Lorenz2017-11-011-5/+14
| | | | llvm-svn: 317056
* [refactor] Describe refactorings in the operation classesAlex Lorenz2017-10-271-83/+32
| | | | | | | | | | | | | | | | | 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] Initial outline of implementation of "extract function" refactoringAlex Lorenz2017-10-241-0/+232
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
OpenPOWER on IntegriCloud