[clang-tools-extra] r320577 - [clangd] clang-format the source code. NFC
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 13 04:53:17 PST 2017
Author: ibiryukov
Date: Wed Dec 13 04:53:16 2017
New Revision: 320577
URL: http://llvm.org/viewvc/llvm-project?rev=320577&view=rev
Log:
[clangd] clang-format the source code. NFC
Modified:
clang-tools-extra/trunk/clangd/index/Index.cpp
clang-tools-extra/trunk/clangd/index/Index.h
clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp
clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
clang-tools-extra/trunk/unittests/clangd/SymbolCollectorTests.cpp
Modified: clang-tools-extra/trunk/clangd/index/Index.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/Index.cpp?rev=320577&r1=320576&r2=320577&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/Index.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/Index.cpp Wed Dec 13 04:53:16 2017
@@ -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);
}
Modified: clang-tools-extra/trunk/clangd/index/Index.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/Index.h?rev=320577&r1=320576&r2=320577&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/Index.h (original)
+++ clang-tools-extra/trunk/clangd/index/Index.h Wed Dec 13 04:53:16 2017
@@ -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;
Modified: clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp?rev=320577&r1=320576&r2=320577&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp Wed Dec 13 04:53:16 2017
@@ -94,9 +94,7 @@ bool SymbolCollector::handleDeclOccurenc
return true;
}
-void SymbolCollector::finish() {
- Symbols.freeze();
-}
+void SymbolCollector::finish() { Symbols.freeze(); }
} // namespace clangd
} // namespace clang
Modified: clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp?rev=320577&r1=320576&r2=320577&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp Wed Dec 13 04:53:16 2017
@@ -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"
Modified: clang-tools-extra/trunk/unittests/clangd/SymbolCollectorTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/SymbolCollectorTests.cpp?rev=320577&r1=320576&r2=320577&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/SymbolCollectorTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/SymbolCollectorTests.cpp Wed Dec 13 04:53:16 2017
@@ -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 {
More information about the cfe-commits
mailing list