diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2019-12-10 10:08:39 +0100 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2019-12-10 10:22:43 +0100 |
| commit | b63c35ebf76ca0ac89405aeadee2b98a0e91e05e (patch) | |
| tree | 4c5faffa7550bd0c1b6c8e280f331b0a246aa709 /clang-tools-extra/clangd/FindSymbols.cpp | |
| parent | dbf520f617440d62ca46f64cdc41159945911902 (diff) | |
| download | bcm5719-llvm-b63c35ebf76ca0ac89405aeadee2b98a0e91e05e.tar.gz bcm5719-llvm-b63c35ebf76ca0ac89405aeadee2b98a0e91e05e.zip | |
[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.
Diffstat (limited to 'clang-tools-extra/clangd/FindSymbols.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/FindSymbols.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/FindSymbols.cpp b/clang-tools-extra/clangd/FindSymbols.cpp index 619f1a5cfdb..4c92c8896b9 100644 --- a/clang-tools-extra/clangd/FindSymbols.cpp +++ b/clang-tools-extra/clangd/FindSymbols.cpp @@ -131,7 +131,7 @@ namespace { llvm::Optional<DocumentSymbol> declToSym(ASTContext &Ctx, const NamedDecl &ND) { auto &SM = Ctx.getSourceManager(); - SourceLocation NameLoc = spellingLocIfSpelled(findName(&ND), SM); + SourceLocation NameLoc = nameLocation(ND, SM); // getFileLoc is a good choice for us, but we also need to make sure // sourceLocToPosition won't switch files, so we call getSpellingLoc on top of // that to make sure it does not switch files. |

