summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@vmiklos.hu>2017-09-11 20:18:38 +0000
committerMiklos Vajna <vmiklos@vmiklos.hu>2017-09-11 20:18:38 +0000
commitbf0d49c437813c4c0cfe14bf867933cfd5ed301e (patch)
tree94b64bf0990dd1c7b68f581aefe29c8392e63b03 /clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp
parent015bded23ff905426b56699625f3d43cd3dfda27 (diff)
downloadbcm5719-llvm-bf0d49c437813c4c0cfe14bf867933cfd5ed301e.tar.gz
bcm5719-llvm-bf0d49c437813c4c0cfe14bf867933cfd5ed301e.zip
clang-rename: let -force handle multiple renames
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
Diffstat (limited to 'clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp')
-rw-r--r--clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp b/clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp
index bac3963e1bd..43287acb95e 100644
--- a/clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp
+++ b/clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp
@@ -198,8 +198,11 @@ private:
return false;
}
- if (Force)
+ if (Force) {
+ SpellingNames.push_back(std::string());
+ USRList.push_back(std::vector<std::string>());
return true;
+ }
unsigned CouldNotFindSymbolNamed = Engine.getCustomDiagID(
DiagnosticsEngine::Error, "clang-rename could not find symbol %0");
OpenPOWER on IntegriCloud