[clangd] clang-format the source code. NFC

llvm-svn: 333537
This commit is contained in:
Ilya Biryukov 2018-05-30 12:41:19 +00:00
parent f909058ad4
commit 8573defa2d
7 changed files with 26 additions and 27 deletions

View File

@ -26,7 +26,7 @@ namespace clangd {
///
/// The returned location is usually the spelling location where the name of the
/// decl occurs in the code.
SourceLocation findNameLoc(const clang::Decl* D);
SourceLocation findNameLoc(const clang::Decl *D);
} // namespace clangd
} // namespace clang

View File

@ -116,8 +116,8 @@ private:
Compare Greater;
};
/// Returns a string that sorts in the same order as (-Score, Tiebreak), for LSP.
/// (The highest score compares smallest so it sorts at the top).
/// Returns a string that sorts in the same order as (-Score, Tiebreak), for
/// LSP. (The highest score compares smallest so it sorts at the top).
std::string sortText(float Score, llvm::StringRef Tiebreak = "");
} // namespace clangd

View File

@ -45,7 +45,7 @@ public:
// The Context returned by beginSpan is active, but Args is not ready.
// Tracers should not override this unless they need to observe strict
// per-thread nesting. Instead they should observe context destruction.
virtual void endSpan() {};
virtual void endSpan(){};
/// Called for instant events.
virtual void instant(llvm::StringRef Name, json::obj &&Args) = 0;

View File

@ -107,9 +107,8 @@ public:
/// Returns the include path of the file (e.g. <path>, "path"), which can be
/// #included directly. See URI::includeSpelling for details.
virtual llvm::Expected<std::string>
getIncludeSpelling(const URI& U) const {
return ""; // no customized include path for this scheme.
virtual llvm::Expected<std::string> getIncludeSpelling(const URI &U) const {
return ""; // no customized include path for this scheme.
}
};

View File

@ -90,4 +90,4 @@ void addSystemHeadersMapping(CanonicalIncludes *Includes);
} // namespace clangd
} // namespace clang
#endif //LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_HEADERMAPCOLLECTOR_H
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_HEADERMAPCOLLECTOR_H

View File

@ -228,27 +228,27 @@ public:
// SymbolSlab::Builder is a mutable container that can 'freeze' to SymbolSlab.
// The frozen SymbolSlab will use less memory.
class Builder {
public:
// Adds a symbol, overwriting any existing one with the same ID.
// This is a deep copy: underlying strings will be owned by the slab.
void insert(const Symbol& S);
public:
// Adds a symbol, overwriting any existing one with the same ID.
// This is a deep copy: underlying strings will be owned by the slab.
void insert(const Symbol &S);
// Returns the symbol with an ID, if it exists. Valid until next insert().
const Symbol* find(const SymbolID &ID) {
auto I = SymbolIndex.find(ID);
return I == SymbolIndex.end() ? nullptr : &Symbols[I->second];
}
// Returns the symbol with an ID, if it exists. Valid until next insert().
const Symbol *find(const SymbolID &ID) {
auto I = SymbolIndex.find(ID);
return I == SymbolIndex.end() ? nullptr : &Symbols[I->second];
}
// Consumes the builder to finalize the slab.
SymbolSlab build() &&;
// Consumes the builder to finalize the slab.
SymbolSlab build() &&;
private:
llvm::BumpPtrAllocator Arena;
// Intern table for strings. Contents are on the arena.
llvm::DenseSet<llvm::StringRef> Strings;
std::vector<Symbol> Symbols;
// Values are indices into Symbols vector.
llvm::DenseMap<SymbolID, size_t> SymbolIndex;
private:
llvm::BumpPtrAllocator Arena;
// Intern table for strings. Contents are on the arena.
llvm::DenseSet<llvm::StringRef> Strings;
std::vector<Symbol> Symbols;
// Values are indices into Symbols vector.
llvm::DenseMap<SymbolID, size_t> SymbolIndex;
};
private:

View File

@ -40,7 +40,7 @@ std::string SymbolToYAML(Symbol Sym);
// Convert symbols to a YAML-format string.
// The YAML result is safe to concatenate if you have multiple symbol slabs.
void SymbolsToYAML(const SymbolSlab& Symbols, llvm::raw_ostream &OS);
void SymbolsToYAML(const SymbolSlab &Symbols, llvm::raw_ostream &OS);
} // namespace clangd
} // namespace clang