[PATCH] D47471: [clangd] Minor cleanup
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 29 04:54:55 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL333411: [clangd] Minor cleanup (authored by omtcyfz, committed by ).
Herald added subscribers: llvm-commits, klimek.
Changed prior to commit:
https://reviews.llvm.org/D47471?vs=148847&id=148887#toc
Repository:
rL LLVM
https://reviews.llvm.org/D47471
Files:
clang-tools-extra/trunk/clangd/CodeComplete.cpp
clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
Index: clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
@@ -33,7 +33,7 @@
// Build an in-memory static index for global symbols from a YAML-format file.
// The size of global symbols should be relatively small, so that all symbols
// can be managed in memory.
-std::unique_ptr<SymbolIndex> BuildStaticIndex(llvm::StringRef YamlSymbolFile) {
+std::unique_ptr<SymbolIndex> buildStaticIndex(llvm::StringRef YamlSymbolFile) {
auto Buffer = llvm::MemoryBuffer::getFile(YamlSymbolFile);
if (!Buffer) {
llvm::errs() << "Can't open " << YamlSymbolFile << "\n";
@@ -223,7 +223,7 @@
Opts.BuildDynamicSymbolIndex = EnableIndex;
std::unique_ptr<SymbolIndex> StaticIdx;
if (EnableIndex && !YamlSymbolFile.empty()) {
- StaticIdx = BuildStaticIndex(YamlSymbolFile);
+ StaticIdx = buildStaticIndex(YamlSymbolFile);
Opts.StaticIndex = StaticIdx.get();
}
Opts.AsyncThreadsCount = WorkerThreadsCount;
Index: clang-tools-extra/trunk/clangd/CodeComplete.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/CodeComplete.cpp
+++ clang-tools-extra/trunk/clangd/CodeComplete.cpp
@@ -359,13 +359,13 @@
// Get all scopes that will be queried in indexes.
std::vector<std::string> getQueryScopes(CodeCompletionContext &CCContext,
- const SourceManager& SM) {
- auto GetAllAccessibleScopes = [](CodeCompletionContext& CCContext) {
+ const SourceManager &SM) {
+ auto GetAllAccessibleScopes = [](CodeCompletionContext &CCContext) {
SpecifiedScope Info;
- for (auto* Context : CCContext.getVisitedContexts()) {
+ for (auto *Context : CCContext.getVisitedContexts()) {
if (isa<TranslationUnitDecl>(Context))
Info.AccessibleScopes.push_back(""); // global namespace
- else if (const auto*NS = dyn_cast<NamespaceDecl>(Context))
+ else if (const auto *NS = dyn_cast<NamespaceDecl>(Context))
Info.AccessibleScopes.push_back(NS->getQualifiedNameAsString() + "::");
}
return Info;
@@ -397,8 +397,9 @@
Info.AccessibleScopes.push_back(""); // global namespace
Info.UnresolvedQualifier =
- Lexer::getSourceText(CharSourceRange::getCharRange((*SS)->getRange()),
- SM, clang::LangOptions()).ltrim("::");
+ Lexer::getSourceText(CharSourceRange::getCharRange((*SS)->getRange()), SM,
+ clang::LangOptions())
+ .ltrim("::");
// Sema excludes the trailing "::".
if (!Info.UnresolvedQualifier->empty())
*Info.UnresolvedQualifier += "::";
@@ -590,7 +591,7 @@
SigHelp.signatures.push_back(ProcessOverloadCandidate(
Candidate, *CCS,
getParameterDocComment(S.getASTContext(), Candidate, CurrentArg,
- /*CommentsFromHeader=*/false)));
+ /*CommentsFromHeaders=*/false)));
}
}
@@ -696,7 +697,7 @@
&DummyDiagsConsumer, false),
Input.VFS);
if (!CI) {
- log("Couldn't create CompilerInvocation");;
+ log("Couldn't create CompilerInvocation");
return false;
}
auto &FrontendOpts = CI->getFrontendOpts();
@@ -1013,7 +1014,7 @@
LLVM_DEBUG(llvm::dbgs()
<< "CodeComplete: " << C.Name << (IndexResult ? " (index)" : "")
<< (SemaResult ? " (sema)" : "") << " = " << Scores.finalScore
- << "\n"
+ << "\n"
<< Quality << Relevance << "\n");
NSema += bool(SemaResult);
@@ -1035,7 +1036,8 @@
/*CommentsFromHeader=*/false);
}
}
- return Candidate.build(FileName, Scores, Opts, SemaCCS, Includes.get(), DocComment);
+ return Candidate.build(FileName, Scores, Opts, SemaCCS, Includes.get(),
+ DocComment);
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47471.148887.patch
Type: text/x-patch
Size: 4089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180529/d7b423d1/attachment-0001.bin>
More information about the cfe-commits
mailing list