summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-rename
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-rename: fix referenced variable in vim-scriptSaleem Abdulrasool2016-07-191-1/+1
| | | | llvm-svn: 275943
* [clang-rename] apply stylistic fixesKirill Bobyrev2016-07-154-20/+16
| | | | llvm-svn: 275550
* [clang-rename] exit code-related bugfix and code cleanupBenjamin Kramer2016-07-144-28/+27
| | | | | | | | | | | | | | 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-215-6/+58
| | | | | | | | | | | | | | | | | | | | | 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
* [clang-tools] mark TokenName as unusedArtem Belevich2016-06-151-1/+1
| | | | | | Otherwise it produces compiler warning if asserts are disabled. llvm-svn: 272852
* clang-rename: implement renaming of classes with a dtorMiklos Vajna2016-06-151-0/+22
| | | | | | | | | | | The declaration wasn't renamed. Also neither part of the declaration wasn't renamed. Reviewers: klimek Differential Revision: http://reviews.llvm.org/D21364 llvm-svn: 272816
* clang-rename: implement handling of remaining named castsMiklos Vajna2016-06-131-0/+8
| | | | | | | | | | const_cast<> and reinterpret_cast<>. Reviewers: klimek Differential Revision: http://reviews.llvm.org/D21270 llvm-svn: 272574
* clang-rename: implement renaming of classes inside dynamic_castMiklos Vajna2016-06-081-13/+21
| | | | | | | | | | Refactor to do the same as what is done already for static_cast. Reviewers: klimek Differential Revision: http://reviews.llvm.org/D21120 llvm-svn: 272188
* clang-rename: implement renaming of classes inside static_castMiklos Vajna2016-06-061-0/+17
| | | | | | | | | | | "Derived" in static_cast<Derived&>(...) wasn't renamed, nor in its pointer equivalent. Reviewers: klimek Differential Revision: http://reviews.llvm.org/D21012 llvm-svn: 271933
* clang-rename: fix renaming heap allocationsMiklos Vajna2016-06-021-0/+11
| | | | | | | | | | The check failed, 'Cla *C = new Cla();' was renamed to 'D *C = new Cla();'. Reviewers: klimek Differential Revision: http://reviews.llvm.org/D20635 llvm-svn: 271572
* clang-rename: fix renaming non-members variables when referenced as macro ↵Miklos Vajna2016-05-241-1/+3
| | | | | | | | | | | | arguments The second check failed, FOO(C::X) wasn't renamed to FOO(C::Y). Reviewers: klimek Differential Revision: http://reviews.llvm.org/D20537 llvm-svn: 270599
* clang-rename: fix renaming members when referenced as macro argumentsMiklos Vajna2016-05-201-1/+3
| | | | | | | | | | The second check failed, FOO(C.X) wasn't renamed to FOO(C.Y). Reviewers: klimek Differential Revision: http://reviews.llvm.org/D20446 llvm-svn: 270204
* clang-rename: handle non-inline ctor definitions when renaming classesMiklos Vajna2016-05-181-0/+5
| | | | | | | | | | The result of the test was C::D(), not D::D(). Reviewers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D20356 llvm-svn: 269952
* clang-rename: avoid StringRef members in USRLocFindingASTVisitorMiklos Vajna2016-05-171-2/+2
| | | | | | | | | | | | Even if this is defined in the .cpp file and only used as part of the function (so here it's safe), usually storing StringRefs in the class is dangerous, so don't do so. Reviewers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D20296 llvm-svn: 269796
* [clang-rename] Fix broken dependency on shared build.Etienne Bergeron2016-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The build is broken due to a missing dependency. To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Which produce this error: ``` tools/clang/tools/extra/clang-rename/CMakeFiles/clangRename.dir/USRLocFinder.cpp.o: In function `clang::RecursiveASTVisitor<clang::rename::(anonymous namespace)::USRLocFindingASTVisitor>::TraverseCXXConstructorDecl(clang::CXXConstructorDecl*)': USRLocFinder.cpp:(.text._ZN5clang19RecursiveASTVisitorINS_6rename12_GLOBAL__N_123USRLocFindingASTVisitorEE26TraverseCXXConstructorDeclEPNS_18CXXConstructorDeclE+0x170): undefined reference to `clang::Lexer::getSourceText(clang::CharSourceRange, clang::SourceManager const&, clang::LangOptions const&, bool*)' ``` Reviewers: alexfh, yaron.keren Subscribers: yaron.keren, cfe-commits Differential Revision: http://reviews.llvm.org/D20240 llvm-svn: 269429
* clang-rename: check that the source location we find actually has the old nameMiklos Vajna2016-05-133-7/+20
| | | | | | | | | | | This more general check could have prevented the specific problem "getSourceOrder() == -1" guards. Reviewers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D20216 llvm-svn: 269402
* clang-rename: fix renaming of field with implicit initializersMiklos Vajna2016-05-111-0/+5
| | | | | | | | | | The last check failed as Cla::Cla() was rewritten to Cla::hector(). Reviewers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D20150 llvm-svn: 269161
* clang-rename: when renaming a field, rename initializers of that field as wellMiklos Vajna2016-05-071-0/+13
| | | | | | | | | | Summary: The second check failed, the initializer wasn't renamed. Reviewers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D19957 llvm-svn: 268857
* When renaming a class, ename pointers to that class as well.Manuel Klimek2016-05-041-0/+12
| | | | | | Patch by Miklos Vajna. llvm-svn: 268484
* 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-173-13/+3
| | | | | | Differential revision: http://reviews.llvm.org/D18231 llvm-svn: 263726
* Remove autoconf supportChris Bieneman2016-01-262-29/+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 r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but ↵Yaron Keren2015-07-032-7/+10
| | | | | | now fails the bots. llvm-svn: 241335
* Replace some const std::string & with llvm::StringRef or std::stringYaron Keren2015-07-032-10/+7
| | | | | | | | and std::move to avoid implicit std::string construction. Patch by Eugene Kosov. llvm-svn: 241330
* Change range-based for-loop to be -Wrange-loop-analysis clean.Richard Trieu2015-04-151-1/+1
| | | | | | No functionality change. llvm-svn: 234965
* 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-144-9/+9
| | | | | | | 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-302-5/+0
| | | | llvm-svn: 220893
* [CMake] Add dependencies on clangToolingCore.NAKAMURA Takumi2014-10-301-0/+1
| | | | llvm-svn: 220890
* [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-135-14/+32
| | | | | | | | This allows the unit tests to link the library. Patch by Xin Huang. llvm-svn: 219609
* Revert rL215947: "[clang-rename] revert r215839"Manuel Klimek2014-08-2011-0/+835
| | | | | | Make tests not depend on grep supporting -bo. llvm-svn: 216041
* [clang-rename] revert r215839Gerolf Hoflehner2014-08-1811-835/+0
| | | | | | | | | | | | | | | | | | | | The commit broke public build bots for more than 24 hours. (view as text) ******************** TEST 'Clang Tools :: clang-rename/VarTest.cpp' FAILED ******************** Script: -- cat /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp > /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp clang-rename -offset=$(grep -FUbo 'foo;' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | head -1 | cut -d: -f1) -new-name=hector /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp -i -- sed 's,//.*,,' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | FileCheck /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp -- Exit Code: 1 Command Output (stderr): -- clang-rename: could not find symbol at /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp:2:1 (offset 14). llvm-svn: 215947
* [CMake] clang-rename: Optimize libdeps.NAKAMURA Takumi2014-08-181-9/+0
| | | | llvm-svn: 215935
* Add trailing linefeed.NAKAMURA Takumi2014-08-181-1/+1
| | | | llvm-svn: 215934
* Fix link libraries for clang-rename.Manuel Klimek2014-08-171-0/+7
| | | | llvm-svn: 215843
* Remove mention of non-existent 'test' directory.Manuel Klimek2014-08-171-3/+0
| | | | llvm-svn: 215840
* First version of a clang-rename tool.Manuel Klimek2014-08-1711-0/+840
Summary: Note that this code is still grossly under-tested - the next steps will be to add significantly better test coverage. Patch by Matthew Plant. Test Plan: Reviewers: Subscribers: llvm-svn: 215839
OpenPOWER on IntegriCloud