From f2001aa74394885dc178c5997b83687acb4f55e4 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Mon, 7 Jan 2019 15:45:19 +0000 Subject: [clangd] Remove 'using namespace llvm' from .cpp files. NFC The new guideline is to qualify with 'llvm::' explicitly both in '.h' and '.cpp' files. This simplifies moving the code between header and source files and is easier to keep consistent. llvm-svn: 350531 --- clang-tools-extra/clangd/CodeCompletionStrings.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'clang-tools-extra/clangd/CodeCompletionStrings.cpp') diff --git a/clang-tools-extra/clangd/CodeCompletionStrings.cpp b/clang-tools-extra/clangd/CodeCompletionStrings.cpp index eeec99cafe9..42a8693f482 100644 --- a/clang-tools-extra/clangd/CodeCompletionStrings.cpp +++ b/clang-tools-extra/clangd/CodeCompletionStrings.cpp @@ -14,17 +14,16 @@ #include "clang/Basic/SourceManager.h" #include -using namespace llvm; namespace clang { namespace clangd { namespace { bool isInformativeQualifierChunk(CodeCompletionString::Chunk const &Chunk) { return Chunk.Kind == CodeCompletionString::CK_Informative && - StringRef(Chunk.Text).endswith("::"); + llvm::StringRef(Chunk.Text).endswith("::"); } -void appendEscapeSnippet(const StringRef Text, std::string *Out) { +void appendEscapeSnippet(const llvm::StringRef Text, std::string *Out) { for (const auto Character : Text) { if (Character == '$' || Character == '}' || Character == '\\') Out->push_back('\\'); @@ -32,13 +31,13 @@ void appendEscapeSnippet(const StringRef Text, std::string *Out) { } } -bool looksLikeDocComment(StringRef CommentText) { +bool looksLikeDocComment(llvm::StringRef CommentText) { // We don't report comments that only contain "special" chars. // This avoids reporting various delimiters, like: // ================= // ----------------- // ***************** - return CommentText.find_first_not_of("/*-= \t\r\n") != StringRef::npos; + return CommentText.find_first_not_of("/*-= \t\r\n") != llvm::StringRef::npos; } } // namespace @@ -97,7 +96,7 @@ void getSignature(const CodeCompletionString &CCS, std::string *Signature, // treat them carefully. For Objective-C methods, all typed-text chunks // will end in ':' (unless there are no arguments, in which case we // can safely treat them as C++). - if (!StringRef(Chunk.Text).endswith(":")) { // Treat as C++. + if (!llvm::StringRef(Chunk.Text).endswith(":")) { // Treat as C++. if (RequiredQualifiers) *RequiredQualifiers = std::move(*Signature); Signature->clear(); @@ -171,7 +170,7 @@ void getSignature(const CodeCompletionString &CCS, std::string *Signature, } std::string formatDocumentation(const CodeCompletionString &CCS, - StringRef DocComment) { + llvm::StringRef DocComment) { // Things like __attribute__((nonnull(1,3))) and [[noreturn]]. Present this // information in the documentation field. std::string Result; -- cgit v1.2.3