summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-rename/tool/ClangRename.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [refactor] Move clang-rename into the clang repositoryAlex Lorenz2017-06-301-240/+0
| | | | | | | | | | | | 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
* clang-rename: add new -force optionMiklos Vajna2017-06-021-1/+10
| | | | | | | | | | | | | | | | | Summary: The use-case is when renaming a widely used name, like a lower-level class in a codebase and clang-rename is simply invoked for each translation unit based on the compile database. In this case it's not interesting to show errors: not finding the symbol means there is simply nothing to do. Reviewers: klimek Reviewed By: klimek Differential Revision: https://reviews.llvm.org/D32403 llvm-svn: 304534
* [clang-rename] Fix handling of unchanged filesAlexander Shaposhnikov2016-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Fix the output of clang-rename for the files without modifications. Update the code in clang-reorder-fields/tool/ClangReorderFields.cpp to avoid inconsistency. Example: a.h: struct A {}; a.cpp: #include "a.h" int main() { return 0; } Before the changes the output looks like this: clang-rename -qualified-name=A -new-name=B a.cpp <<<<<INVALID SOURCE LOCATION>>>>> Test plan: make -j8 check-clang-tools Differential revision: https://reviews.llvm.org/D24634 llvm-svn: 281826
* [clang-rename] Merge rename-{at|all} & optimise.Kirill Bobyrev2016-09-161-145/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | Having both rename-at and rename-all both seems confusing and introduces unneeded difficulties. After merging rename-at and rename-all maintaining main function wrappers and custom help becomes redundant while CLI becomes less confusing. D24224 (which was the original patch causing buildbot failures) wasn't aware of bugs caused by passing both -offset and -qualified-name. After D24224 was landed it caused buildbot failures and therefor I just reverted it. Two things that make this patch different from D24224 are: * unittests/clang-rename was deleted, because it is unmaintained and doesn't do much. * Passing both `-offset` and `-qualified-name` isn't allowed anymore for the sake of preventing bugs. This patch is a trivial enhancement of accepted D24224 revision. Tested with `ninja check-all`. Differential Revision: https://reviews.llvm.org/D24567 llvm-svn: 281710
* reverting r281456Kirill Bobyrev2016-09-141-60/+145
| | | | llvm-svn: 281459
* [clang-rename] Merge rename-{at|all} & optimize.Kirill Bobyrev2016-09-141-145/+60
| | | | | | | | | | | | | | Having both rename-at and rename-all both seems confusing and introduces unneeded difficulties. Allowing to use both -qualified-name and -offset at once while performing efficient renamings seems like a feature, too. Maintaining main function wrappers and custom help becomes redundant while CLI becomes less confusing. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D24224 llvm-svn: 281456
* minor header guards and help messages cleanupKirill Bobyrev2016-08-191-1/+1
| | | | llvm-svn: 279226
* clang-rename YAML reader: address post-commit commentsMiklos Vajna2016-08-101-6/+5
| | | | llvm-svn: 278201
* clang-rename rename-all: support reading old/newname pairs from a YAML fileMiklos Vajna2016-08-091-1/+57
| | | | | | | | | | | This is handy in case by the time clang-rename is invoked, an external tool already genereated a list of oldname -> newname pairs to handle. Reviewers: omtcyfz Differential Revision: https://reviews.llvm.org/D23198 llvm-svn: 278145
* [clang-rename] add missing clang-format improvementsKirill Bobyrev2016-08-041-2/+2
| | | | | | | | r277702 introduced clang-format changes so that later commits wouldn't introduce non-functional changes while running clang-format before commiting. Though, few changes by clang-format weren't in the patch. llvm-svn: 277709
* clang-rename: split existing options into two new subcommandsMiklos Vajna2016-08-021-70/+142
| | | | | | | | | | | | | | | - rename-at is meant to be integrated with editors and works mainly off of a location in a file, and this is the default - rename-all is optimized for one or more oldname->newname renames, and works with clang-apply-replacements Reviewers: bkramer, klimek Subscribers: omtcyfz Differential Revision: https://reviews.llvm.org/D21814 llvm-svn: 277438
* Changes related to new implementation of tooling::Replacements as class.Eric Liu2016-08-011-3/+4
| | | | | | | | | | | | Summary: See http://reviews.llvm.org/D21748 for details. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21749 llvm-svn: 277336
* [Clang-rename] Remove custom version, fix extra space in error message.Eugene Zelenko2016-07-251-20/+12
| | | | | | | | Also fixed some Include What You Use Warnings. Differential revision: https://reviews.llvm.org/D22654 llvm-svn: 276684
* [clang-rename] check whether -new-name is valid identifier in C++17 Kirill Bobyrev2016-07-211-1/+12
| | | | llvm-svn: 276259
* [clang-rename] apply stylistic fixesKirill Bobyrev2016-07-151-4/+4
| | | | llvm-svn: 275550
* [clang-rename] exit code-related bugfix and code cleanupBenjamin Kramer2016-07-141-6/+6
| | | | | | | | | | | | | | This patch does the following: * enforces proper formatting for few files (i.e. deals with 80 linewidth violations and few other things) * ensures '\n' chars are passed to the output streams instead of "\n" strings * fixes a bug caused by calling cl::PrintHelpMessage(), which occasionally calls exit(0), so that exit(1) (which is right after cl::PrintHelpMessage line) becomes dead code Patch by Kirill Bobyrev! Differential Revision: http://reviews.llvm.org/D22091 llvm-svn: 275387
* clang-rename: add a -export-fixes optionMiklos Vajna2016-06-271-0/+27
| | | | | | | | | | | | | | | | | | Use case: a class is declared in a header, and defined in two translation units. clang-rename is asked to rename a class member that's referenced in both translation units. Using -i is not possible, as in case the first clang-rename invocation touches the header, the second invocation will result in compilation errors. Using -export-fixes handles this situation, each invocation can work on the original source, and at the end the user can apply the replacements with clang-apply-replacements. Reviewers: klimek Differential Revision: http://reviews.llvm.org/D21676 llvm-svn: 273910
* clang-rename: add a -old-name optionMiklos Vajna2016-06-211-1/+6
| | | | | | | | | | | | | | | | | | | | | This is similar to -offset with the following differences: 1) -offset can refer to local variables as well. 2) -old-name makes it easier to refer to e.g. ClassName::MemberName by spelling out the fully qualified name, instead of having to use e.g. grep to look up the exact offset. In other words, -offset is great when clang-rename is invoked by e.g. an IDE, but not really user-friendly when the tool is invoked by the user from commandline. That's the use case where -old-name is supposed to improve the situation. Reviewers: klimek Differential Revision: http://reviews.llvm.org/D21517 llvm-svn: 273304
* Add missing newline in clang-rename output.Manuel Klimek2016-04-281-1/+1
| | | | | | | | Patch by Miklos Vajna. Differential Revision: http://reviews.llvm.org/D18957 llvm-svn: 267855
* Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes.Eugene Zelenko2016-03-171-5/+1
| | | | | | Differential revision: http://reviews.llvm.org/D18231 llvm-svn: 263726
* [cleanup] Re-sort the #include lines with llvm/utils/sort_includes.pyChandler Carruth2015-01-141-4/+4
| | | | | | | No functionality changed, this is just a mechanical cleanup to keep the order of #include lines consistent across the project. llvm-svn: 225976
* Re-structure clang-rename into a library and the tool.Manuel Klimek2014-10-131-0/+151
This allows the unit tests to link the library. Patch by Xin Huang. llvm-svn: 219609
OpenPOWER on IntegriCloud