[PATCH] D21814: clang-rename: split existing options into two new subcommands

Miklos Vajna via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 22 00:45:30 PDT 2016


vmiklos added inline comments.

================
Comment at: clang-rename/RenamingAction.cpp:48
@@ +47,3 @@
+    for (unsigned I = 0; I < NewNameList.size(); ++I) {
+      HandleOneRename(Context, NewNameList[I], PrevNameList[I], USRList[I]);
+    }
----------------
klimek wrote:
> Question is whether if we go down that route we shouldn't do one search for all the names, instead of re-looping for each name.
You mean improving USRLocFindingASTVisitor, so that it can work with a list of USRs, not with just a single USR? I can do that, but if possible, I would like to do that as a follow-up patch; it was called in a loop already before this patch, so sounds orthogonal. (And it would potentially conflict with any pending patches that touch that class.)

I could fold HandleOneRename() into HandleTranslationUnit(), but that just makes the resulting function larger, and does not get rid of the looping. Or is that what you want?


https://reviews.llvm.org/D21814





More information about the cfe-commits mailing list