[PATCH] D24224: [clang-rename] Merge rename-{ at | all } and optimise USRFindingAction.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 7 04:13:42 PDT 2016

alexfh requested changes to this revision.
This revision now requires changes to proceed.

Comment at: clang-rename/USRFindingAction.cpp:158
@@ +157,3 @@
+    FoundDecl = QualifiedName.empty() ? getNamedDeclAt(Context, Point)
+                                      : getNamedDeclFor(Context, QualifiedName);
Merge this to the variable declaration.

Comment at: clang-rename/USRFindingAction.cpp:169
@@ -160,2 +168,3 @@
                << SymbolOffset << ").\n";
+        exit(1);
       } else {
I'd better not use `exit()` in library code and try to find a way to signal the error to the caller (e.g. make the function return a bool so that HandleTranslationUnit doesn't do useless work, and use ASTContext::getDiagnostics() to report errors; or add a separate callback, if this doesn't work for some reason).


More information about the cfe-commits mailing list