summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-rename/USRLocFinder.h
Commit message (Collapse)AuthorAgeFilesLines
* [refactor] Move clang-rename into the clang repositoryAlex Lorenz2017-06-301-49/+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: fix formattingMiklos Vajna2017-04-231-1/+1
| | | | | | As detected by clang-format. llvm-svn: 301130
* Wdocumentation fixSimon Pilgrim2017-04-061-3/+3
| | | | llvm-svn: 299642
* [clang-rename] Support renaming qualified symbolHaojian Wu2017-04-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch adds a new feature for renaming qualified symbol references. Unlike orginal clang-rename behavior, when renaming a qualified symbol to a new qualified symbol (e.g "A::Foo" => "B::Bar"), this new rename behavior will consider the prefix qualifiers of the symbol, and calculate the new prefix qualifiers. It aims to add as few additional qualifiers as possible. As this is an early version (only supports renaming classes), I don't change current clang-rename interfaces at the moment, and would like to keep its (command-line tool) behavior. So I added new interfaces for the prototype. In the long run, these interfaces should be unified. No functionality changes in original clang-rename command-line tool. This patch also contains a few bug fixes of clang-rename which are discovered by the new unittest: * fix a potential nullptr accessment when class declaration doesn't have definition. * add USRs of nested declartaions in "getNamedDeclFor". Reviewers: ioeric Reviewed By: ioeric Subscribers: alexfh, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D31176 llvm-svn: 299419
* [clang-rename] speedup RenamingActionKirill Bobyrev2016-07-291-1/+2
| | | | | | | | | | | | The complexity of renaming a USR is O(N) [N stands for number of nodes in Translation Unit]. In some cases there are more than one USR for a single symbol (see overridden functions and ctor/dtor handling), which means that the complexity of finding all of the corresponding USRs is O(N * M) [M stands for number of USRs corresponding to the symbols, which may be not quite small]. With a simple tweak we can make it O(N * log(M)) by passing whole list of USRs corresponding to the symbol to USRLocFinder. llvm-svn: 277131
* [clang-rename] exit code-related bugfix and code cleanupBenjamin Kramer2016-07-141-11/+7
| | | | | | | | | | | | | | 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: check that the source location we find actually has the old nameMiklos Vajna2016-05-131-1/+4
| | | | | | | | | | | 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
* Revert rL215947: "[clang-rename] revert r215839"Manuel Klimek2014-08-201-0/+35
| | | | | | Make tests not depend on grep supporting -bo. llvm-svn: 216041
* [clang-rename] revert r215839Gerolf Hoflehner2014-08-181-35/+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
* First version of a clang-rename tool.Manuel Klimek2014-08-171-0/+35
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