[clangd] clang-format the source code. NFC
authorIlya Biryukov <ibiryukov@google.com>
Wed, 13 Dec 2017 12:53:16 +0000 (12:53 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 13 Dec 2017 12:53:16 +0000 (12:53 +0000)
llvm-svn: 320577

clang-tools-extra/clangd/index/Index.cpp
clang-tools-extra/clangd/index/Index.h
clang-tools-extra/clangd/index/SymbolCollector.cpp
clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp

index 1914cf57df2f5de21842fef714ded75e4f587777..79006bf27c581dab724377e6769ff0fa55d5f3b1 100644 (file)
@@ -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 SymbolIDSymID) 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);
 }
 
index 6d4711cccb1360b408db7bdab14907935142c0ee..4c960865773b7af9f138b0638c5f4af3febc10e6 100644 (file)
@@ -45,7 +45,7 @@ public:
   SymbolID() = default;
   SymbolID(llvm::StringRef USR);
 
-  bool operator==(const SymbolIDSym) 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 SymbolIDSymID) 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;
index 06a80f4d14b5e1714cb6d975824fd3c8b6d26ec4..c2ddecbfc47b6c40350eb6c12b24d133f5a0ce16 100644 (file)
@@ -94,9 +94,7 @@ bool SymbolCollector::handleDeclOccurence(
   return true;
 }
 
-void SymbolCollector::finish() {
-  Symbols.freeze();
-}
+void SymbolCollector::finish() { Symbols.freeze(); }
 
 } // namespace clangd
 } // namespace clang
index 8609873fa191e37319fe80779e1cd3fff785543d..5739dc0efa5b0e2736d54329f3037405d46b3213 100644 (file)
@@ -8,8 +8,8 @@
 //===----------------------------------------------------------------------===//
 #include "ClangdServer.h"
 #include "Compiler.h"
-#include "Matchers.h"
 #include "Context.h"
+#include "Matchers.h"
 #include "Protocol.h"
 #include "TestFS.h"
 #include "gmock/gmock.h"
index 77b2a087e7dd36a5637cd2541c18591e3453247e..f0aef3599ec8b2f69a3ce18804b3a643acf02a14 100644 (file)
@@ -8,25 +8,25 @@
 //===----------------------------------------------------------------------===//
 
 #include "index/SymbolCollector.h"
-#include "clang/Index/IndexingAction.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/FileSystemOptions.h"
 #include "clang/Basic/VirtualFileSystem.h"
 #include "clang/Frontend/CompilerInstance.h"
+#include "clang/Index/IndexingAction.h"
 #include "clang/Tooling/Tooling.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/MemoryBuffer.h"
-#include "gtest/gtest.h"
 #include "gmock/gmock.h"
+#include "gtest/gtest.h"
 
 #include <memory>
 #include <string>
 
-using testing::UnorderedElementsAre;
 using testing::Eq;
 using testing::Field;
+using testing::UnorderedElementsAre;
 
 // GMock helpers for matching Symbol.
 MATCHER_P(QName, Name, "") { return arg.second.QualifiedName == Name; }
@@ -36,7 +36,7 @@ namespace clangd {
 
 namespace {
 class SymbolIndexActionFactory : public tooling::FrontendActionFactory {
- public:
+public:
   SymbolIndexActionFactory() = default;
 
   clang::FrontendAction *create() override {