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

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 29 21:20:33 PDT 2017


alexshap added inline comments.


================
Comment at: tools/extra/clang-rename/tool/ClangRename.cpp:167
       FindingAction.getUSRList();
   const std::vector<std::string> &PrevNames = FindingAction.getUSRSpellings();
   if (PrintName) {
----------------
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


Repository:
  rL LLVM

https://reviews.llvm.org/D34696





More information about the cfe-commits mailing list