diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2017-12-13 12:53:16 +0000 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2017-12-13 12:53:16 +0000 |
| commit | 4f93f1b16100d3f373eb8eb16a43200ae8914c5e (patch) | |
| tree | 5377e9b0d8b4981ecc45231029dbaae7ec3968af /clangd | |
| parent | d4035d3dada4a9d8f791966b2c075af94376b1a7 (diff) | |
[clangd] clang-format the source code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clangd')
| -rw-r--r-- | clangd/index/Index.cpp | 17 | ||||
| -rw-r--r-- | clangd/index/Index.h | 8 | ||||
| -rw-r--r-- | clangd/index/SymbolCollector.cpp | 4 |
3 files changed, 10 insertions, 19 deletions
diff --git a/clangd/index/Index.cpp b/clangd/index/Index.cpp index 1914cf57..79006bf2 100644 --- a/clangd/index/Index.cpp +++ b/clangd/index/Index.cpp @@ -23,25 +23,18 @@ ArrayRef<uint8_t> toArrayRef(StringRef S) { SymbolID::SymbolID(llvm::StringRef USR) : HashValue(llvm::SHA1::hash(toArrayRef(USR))) {} -SymbolSlab::const_iterator SymbolSlab::begin() const { - return Symbols.begin(); -} +SymbolSlab::const_iterator SymbolSlab::begin() const { return Symbols.begin(); } -SymbolSlab::const_iterator SymbolSlab::end() const { - return Symbols.end(); -} +SymbolSlab::const_iterator SymbolSlab::end() const { return Symbols.end(); } -SymbolSlab::const_iterator SymbolSlab::find(const SymbolID& SymID) const { +SymbolSlab::const_iterator SymbolSlab::find(const SymbolID &SymID) const { return Symbols.find(SymID); } -void SymbolSlab::freeze() { - Frozen = true; -} +void SymbolSlab::freeze() { Frozen = true; } void SymbolSlab::insert(Symbol S) { - assert(!Frozen && - "Can't insert a symbol after the slab has been frozen!"); + assert(!Frozen && "Can't insert a symbol after the slab has been frozen!"); Symbols[S.ID] = std::move(S); } diff --git a/clangd/index/Index.h b/clangd/index/Index.h index 6d4711cc..4c960865 100644 --- a/clangd/index/Index.h +++ b/clangd/index/Index.h @@ -45,7 +45,7 @@ public: SymbolID() = default; SymbolID(llvm::StringRef USR); - bool operator==(const SymbolID& Sym) const { + bool operator==(const SymbolID &Sym) const { return HashValue == Sym.HashValue; } @@ -89,14 +89,14 @@ struct Symbol { // FIXME: Use a space-efficient implementation, a lot of Symbol fields could // share the same storage. class SymbolSlab { - public: +public: using const_iterator = llvm::DenseMap<SymbolID, Symbol>::const_iterator; SymbolSlab() = default; const_iterator begin() const; const_iterator end() const; - const_iterator find(const SymbolID& SymID) const; + const_iterator find(const SymbolID &SymID) const; // Once called, no more symbols would be added to the SymbolSlab. This // operation is irreversible. @@ -104,7 +104,7 @@ class SymbolSlab { void insert(Symbol S); - private: +private: bool Frozen = false; llvm::DenseMap<SymbolID, Symbol> Symbols; diff --git a/clangd/index/SymbolCollector.cpp b/clangd/index/SymbolCollector.cpp index 06a80f4d..c2ddecbf 100644 --- a/clangd/index/SymbolCollector.cpp +++ b/clangd/index/SymbolCollector.cpp @@ -94,9 +94,7 @@ bool SymbolCollector::handleDeclOccurence( return true; } -void SymbolCollector::finish() { - Symbols.freeze(); -} +void SymbolCollector::finish() { Symbols.freeze(); } } // namespace clangd } // namespace clang |
