summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-2/+2
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [clangd] Narrow rename to local symbols.Haojian Wu2019-06-251-0/+2
| | | | | | | | | | | | | | | | | | | Summary: Previously, we performed rename for all kinds of symbols (local, global). This patch narrows the scope by only renaming symbols not being used outside of the main file (with index asisitance). Renaming global symbols is not supported at the moment (return an error). Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63426 llvm-svn: 364283
* 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
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* [clang-refactor] Get rid of OccurrencesFinder in RenamingAction, NFCHaojian Wu2017-11-081-18/+9
| | | | | | | | | | | | | | | | | | Summary: The OccurrencesFinder is only used in RenameOccurrences to find symbol occurrences, there is no need to inherit RefactoringRule. Replace it with a single utility function to avoid code misleading. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39796 llvm-svn: 317696
* [clang-refactor] Introduce a new rename rule for qualified symbolsHaojian Wu2017-11-081-0/+56
| | | | | | | | | | | | | | 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] Fix a clang-tidy warning.Haojian Wu2017-10-301-1/+2
| | | | | | NFC llvm-svn: 316895
* [refactor] Describe refactorings in the operation classesAlex Lorenz2017-10-271-57/+29
| | | | | | | | | | | | | | | | | 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
* Fix a few nits in RenamingAction.Haojian Wu2017-10-191-2/+2
| | | | | | | * Add missing override keyword. * avoid unnecessary copy of std::string. llvm-svn: 316152
* [refactor] allow the use of refactoring diagnosticsAlex Lorenz2017-10-161-5/+4
| | | | | | | | | 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 r315087 "[refactor] add support for refactoring options"Alex Lorenz2017-10-131-11/+13
| | | | | | | | | | | | | | | | 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-061-13/+11
| | | | | | clang-refactor crashes on some bots after this commit llvm-svn: 315095
* [refactor] add support for refactoring optionsAlex Lorenz2017-10-061-11/+13
| | | | | | | | | | | | 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
* [refactor] Simplify the refactoring interfaceAlex Lorenz2017-10-021-33/+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-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* clang-rename: let -force handle multiple renamesMiklos Vajna2017-09-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: The use case is that renaming multiple symbols in a large enough codebase is much faster if all of these can be done with a single invocation, but there will be multiple translation units where one or more symbols are not found. Old behavior was to exit with an error (default) or exit without reporting an error (-force). New behavior is that -force results in a best-effort rename: rename symbols which are found and just ignore the rest. The existing help for -force sort of already implies this behavior. Reviewers: cfe-commits, klimek, arphaman Reviewed By: klimek Differential Revision: https://reviews.llvm.org/D37634 llvm-svn: 312942
* [clang] Code cleanup in clang/toolingAlexander Shaposhnikov2017-08-151-1/+1
| | | | | | | | | 1. Add missing explicit for SymbolName constructor. 2. Add missing std::move in createRenameReplacements. Differential revision: https://reviews.llvm.org/D36715 llvm-svn: 310948
* [rename] Introduce symbol occurrencesAlex Lorenz2017-08-141-26/+58
| | | | | | | | | | | Symbol occurrences store the results of local rename and will also be used for the global, indexed rename results. Their kind is used to determine whether they should be renamed automatically or not. They can be converted to a set of AtomicChanges as well. Differential Revision: https://reviews.llvm.org/D36156 llvm-svn: 310853
* [refactor] Move clang-rename into the clang repositoryAlex Lorenz2017-06-301-0/+134
The core engine of clang-rename will be used for local and global renames in the new refactoring engine, as mentioned in http://lists.llvm.org/pipermail/cfe-dev/2017-June/054286.html. The clang-rename tool is still supported but might get deprecated in the future. Differential Revision: https://reviews.llvm.org/D34696 llvm-svn: 306840
OpenPOWER on IntegriCloud