[PATCH] D34949: [refactor][rename] Use a single base class for class that finds a declaration at location and for class that searches for all occurrences of a specific declaration

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 3 08:18:06 PDT 2017


arphaman created this revision.

- Use single `RecursiveSymbolVisitor` class for both `USRLocFindingASTVisitor` and `NamedDeclOccurrenceFindingVisitor` to avoid duplicate visiting code.
- Traverse nested name specifier locs in the new class and remove the separate matching step.
- New class `NamedDeclFindingVisitor` handles search for a declaration by name. We don't have to visit each occurrence to find the declaration, so a simple NamedDecl search should be enough.


Repository:
  rL LLVM

https://reviews.llvm.org/D34949

Files:
  include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h
  include/clang/Tooling/Refactoring/Rename/USRFinder.h
  include/clang/module.modulemap
  lib/Tooling/Refactoring/Rename/USRFinder.cpp
  lib/Tooling/Refactoring/Rename/USRLocFinder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34949.105080.patch
Type: text/x-patch
Size: 20288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170703/44f32b3b/attachment-0001.bin>


More information about the cfe-commits mailing list