[all-commits] [llvm/llvm-project] b63c35: [clangd] Simplify code using findName. NFC

Ilya Biryukov via All-commits all-commits at lists.llvm.org
Tue Dec 10 01:22:59 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b63c35ebf76ca0ac89405aeadee2b98a0e91e05e
      https://github.com/llvm/llvm-project/commit/b63c35ebf76ca0ac89405aeadee2b98a0e91e05e
  Author: Ilya Biryukov <ibiryukov at google.com>
  Date:   2019-12-10 (Tue, 10 Dec 2019)

  Changed paths:
    M clang-tools-extra/clangd/AST.cpp
    M clang-tools-extra/clangd/AST.h
    M clang-tools-extra/clangd/FindSymbols.cpp
    M clang-tools-extra/clangd/SourceCode.cpp
    M clang-tools-extra/clangd/SourceCode.h
    M clang-tools-extra/clangd/XRefs.cpp
    M clang-tools-extra/clangd/index/SymbolCollector.cpp

  Log Message:
  -----------
  [clangd] Simplify code using findName. NFC

`findName` was always used in conjuction with `spellingLocIfSpelled`.
This patch replaces patterns of the form:
  spellingLocIfSpelled(findName(&ND), SM)

With a new helper function:
  nameLocation(ND, SM)

And removes `spellingLocIfSpelled` and `findName`. Both are never used
anywhere else and the latter is an equivalent of `Decl::getLocation` if
we ever need it again.




More information about the All-commits mailing list