summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-rename/tool
Commit message (Collapse)AuthorAgeFilesLines
* [refactor] Move clang-rename into the clang repositoryAlex Lorenz2017-06-304-399/+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
* Make Emacs libraries compatible with Emacs 24.Manuel Klimek2016-10-111-1/+6
| | | | | | | | Emacs 24 doesn't have format-message, fall back to format in that case. Patch by Philipp Stephani. llvm-svn: 283861
* [clang-rename] Overhaul clang-rename.el.Kirill Bobyrev2016-10-021-22/+52
| | | | | | | | | | | | | | | | | | | | | | | * Use lexical binding, as recommended for new libraries. * Fix customization variable (set correct group and type). * Create a new customization group for the library. * Autoload the main clang-rename command so that users don't have to explicitly load the library. * Correctly translate between file and buffer positions using bufferpos-to-filepos (if available) or a fallback. * Don't invoke the shell, it's not necessary and adds complexity. * Save clang-rename output in a buffer and display that on failure. * Save all buffers before calling clang-rename. This is required anyway and prevents data loss when the buffer is later reverted. * In revert-buffer, use keywords instead of t for Boolean arguments to improve readability. * Don't reset buffer modes when reverting. * Emacs treats the character after a symbol as part of the symbol, while clang-rename doesn't; resolve this inconsistency. * Formatting. Patch by Philipp Stephani! Reviewers: omtcyfz Differential Revision: https://reviews.llvm.org/D25156 llvm-svn: 283067
* [clang-rename] Use checktime when reloading vim buffer after applying ↵Kirill Bobyrev2016-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | clang-rename After applying `clang-rename` to a vim buffer (using `clang-rename.py` as part of the vim integration) the buffer gets reloaded using `bufdo`. This solution is suboptimal, since syntax highlighting is turned off for performance reasons and never turned on, after all changes to the source file have been applied. A better solution to this is using `checktime`. It is exactly designed for this kind of task and doesn't have the syntax highlighting issue. Patch by Kai Wolf! Reviewers: omtcyfz Differential Revision: https://reviews.llvm.org/D24791 llvm-svn: 282388
* [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] fix Emacs integration scriptKirill Bobyrev2016-08-021-3/+1
| | | | llvm-svn: 277491
* [clang-rename] fix Emacs script build failureKirill Bobyrev2016-08-021-2/+3
| | | | | | Clang-rename Emacs integration script sometimes doesn't work correctly. llvm-svn: 277469
* 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
* [clang-rename] add basic Emacs integrationKirill Bobyrev2016-08-022-0/+52
| | | | | | | | | | This patch aims to add very basic Emacs integration. Reviewers: hokein, alexfh Differential Revision: https://reviews.llvm.org/D23006 llvm-svn: 277433
* 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
* change Vim key binding for include-fixer and clang-renameKirill Bobyrev2016-07-271-3/+3
| | | | | | | | | | | | Change Vim key binding for include-fixer (`,cf` -> `<leader>cf`) and clang-rename (`,cr` -> `<leader>cr`) to use `<leader>` instead of `,` like cool Vim people (tm) do. Reviewers: ioeric Differential Revision: https://reviews.llvm.org/D22854 llvm-svn: 276870
* [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: fix referenced variable in vim-scriptSaleem Abdulrasool2016-07-191-1/+1
| | | | llvm-svn: 275943
* [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] fix typo in Python script for Vim integrationHaojian Wu2016-07-081-2/+2
| | | | | | | | | | | | Patch by Kirill Bobyrev! Reviewers: kimgr, alexfh, bkramer, ioeric, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D22100 llvm-svn: 274839
* [clang-rename] add basic vim integrationBenjamin Kramer2016-07-071-0/+61
| | | | | | | | | | | | This patch introduces basic Vim integration for clang-rename tool. For setup reference see clang-rename/tool/clang-rename.py Patch by Kirill Bobyrev! Differential revision: http://reviews.llvm.org/D22087 llvm-svn: 274759
* clang-rename: Update libdeps corresponding to r273910.NAKAMURA Takumi2016-06-281-0/+1
| | | | llvm-svn: 273993
* 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
* Remove autoconf supportChris Bieneman2016-01-261-13/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 llvm-svn: 258864
* Revert "Adapt clang-tools-extra to clang module format changes."Adrian Prantl2015-02-251-3/+2
| | | | | | This reverts commit 230424. llvm-svn: 230456
* Adapt clang-tools-extra to clang module format changes.Adrian Prantl2015-02-251-2/+3
| | | | | | | - add clangCodeGen.a to the tools that need it - tweak pp-trace command line handling to not conflict with clang's. llvm-svn: 230424
* Revert "Adapt Makefile dependencies for the clang module format change in ↵Adrian Prantl2015-02-211-9/+2
| | | | | | r230089." llvm-svn: 230104
* Adapt Makefile dependencies for the clang module format change in r230089.Adrian Prantl2015-02-201-2/+9
| | | | llvm-svn: 230090
* [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
* [CMake] Prune redundant libdeps.NAKAMURA Takumi2014-10-301-2/+0
| | | | llvm-svn: 220893
* [CMake] Reformat.NAKAMURA Takumi2014-10-301-1/+2
| | | | llvm-svn: 220888
* Fix Makefiles after r220867.Daniel Jasper2014-10-291-1/+2
| | | | llvm-svn: 220868
* Re-structure clang-rename into a library and the tool.Manuel Klimek2014-10-133-0/+175
This allows the unit tests to link the library. Patch by Xin Huang. llvm-svn: 219609
OpenPOWER on IntegriCloud