summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/CodeCompletionStrings.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2019-01-07 15:45:19 +0000
committerIlya Biryukov <ibiryukov@google.com>2019-01-07 15:45:19 +0000
commitf2001aa74394885dc178c5997b83687acb4f55e4 (patch)
tree80666e16bbebadef8f35d1d962e09da8a7812d13 /clang-tools-extra/clangd/CodeCompletionStrings.cpp
parent25d3de8a0ac4d65f2ac9820ba62a372414780649 (diff)
downloadbcm5719-llvm-f2001aa74394885dc178c5997b83687acb4f55e4.tar.gz
bcm5719-llvm-f2001aa74394885dc178c5997b83687acb4f55e4.zip
[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
Diffstat (limited to 'clang-tools-extra/clangd/CodeCompletionStrings.cpp')
-rw-r--r--clang-tools-extra/clangd/CodeCompletionStrings.cpp13
1 files changed, 6 insertions, 7 deletions
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 <utility>
-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;
OpenPOWER on IntegriCloud