[clangd] Remove a function accidently being added in rL368261.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@368282 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/clangd/AST.cpp b/clangd/AST.cpp
index 1243a46..a51bfdf 100644
--- a/clangd/AST.cpp
+++ b/clangd/AST.cpp
@@ -73,26 +73,6 @@
D->getASTContext().getSourceManager());
}
-// Returns true if the complete name of decl \p D is spelled in the source code.
-// This is not the case for:
-// * symbols formed via macro concatenation, the spelling location will
-// be "<scratch space>"
-// * symbols controlled and defined by a compile command-line option
-// `-DName=foo`, the spelling location will be "<command line>".
-bool isSpelledInSourceCode(const Decl *D) {
- const auto &SM = D->getASTContext().getSourceManager();
- auto Loc = D->getLocation();
- // FIXME: Revisit the strategy, the heuristic is limitted when handling
- // macros, we should use the location where the whole definition occurs.
- if (Loc.isMacroID()) {
- std::string PrintLoc = SM.getSpellingLoc(Loc).printToString(SM);
- if (llvm::StringRef(PrintLoc).startswith("<scratch") ||
- llvm::StringRef(PrintLoc).startswith("<command line>"))
- return false;
- }
- return true;
-}
-
SourceLocation findName(const clang::Decl *D) {
return D->getLocation();
}