[PATCH] D34696: [refactor] Move the core of clang-rename to lib/Tooling/Refactoring

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 30 03:11:57 PDT 2017


arphaman added a comment.

I think I'd rather move `clang-rename` first.



================
Comment at: tools/extra/clang-rename/tool/ClangRename.cpp:167
       FindingAction.getUSRList();
   const std::vector<std::string> &PrevNames = FindingAction.getUSRSpellings();
   if (PrintName) {
----------------
alexshap wrote:
> 1. nit: this line caught my eye (not directly related to the main purpose of this diff):
> getUSRSpellings returns ArrayRef, and ArrayRef has (see the line 271 in include/llvm/ADT/ArrayRef.h) a conversion operator to std::vector<T> (by value). So while it's correct this copy seems to be unnecessary (pls, correct me if i am missing smth) and the fix is easy. If you want i can send a separate diff or i don't mind smb else fixing it.
> 2. nit: USRFindingAction  public methods (getUSRSpellings etc) except newASTConsumer should be const
Thanks for the feedback! I agree with your comments, but would prefer to leave them for a separate patch. I have some similar fixes for some of this code as well.


Repository:
  rL LLVM

https://reviews.llvm.org/D34696





More information about the cfe-commits mailing list