From 60f35303d05ac327a1f23602245ba2e57846586c Mon Sep 17 00:00:00 2001 From: Kirill Bobyrev Date: Tue, 14 Aug 2018 16:03:32 +0000 Subject: NFC: Enforce good formatting across multiple clang-tools-extra files This patch improves readability of multiple files in clang-tools-extra and enforces LLVM Coding Guidelines. Reviewed by: ioeric Differential Revision: https://reviews.llvm.org/D50707 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@339687 91177308-0d34-0410-b5e6-96231b3b80d8 --- clangd/ClangdLSPServer.cpp | 2 +- clangd/ClangdLSPServer.h | 4 ++-- clangd/ClangdUnit.cpp | 4 ++-- clangd/ClangdUnit.h | 7 ++++--- clangd/CodeComplete.cpp | 6 +++--- clangd/CodeComplete.h | 9 +++++---- clangd/CodeCompletionStrings.cpp | 2 +- clangd/CodeCompletionStrings.h | 7 ++++--- clangd/Compiler.cpp | 4 ++-- clangd/Compiler.h | 9 +++++---- clangd/Context.cpp | 4 ++-- clangd/Diagnostics.cpp | 4 ++-- clangd/Diagnostics.h | 6 +++--- clangd/GlobalCompilationDatabase.cpp | 4 ++-- clangd/GlobalCompilationDatabase.h | 6 +++--- clangd/Quality.cpp | 4 ++-- clangd/Quality.h | 14 ++++++++++---- clangd/XRefs.cpp | 4 ++-- clangd/XRefs.h | 10 ++++++---- clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp | 2 +- clangd/index/CanonicalIncludes.h | 2 +- clangd/index/FileIndex.h | 2 +- clangd/index/Index.h | 5 +++-- clangd/index/Merge.cpp | 8 ++++++-- clangd/index/Merge.h | 10 +++++++--- clangd/index/SymbolYAML.h | 2 +- clangd/index/dex/Iterator.h | 2 +- clangd/index/dex/Token.h | 2 +- clangd/index/dex/Trigram.h | 2 +- modularize/ModuleAssistant.cpp | 6 +++--- unittests/clangd/Annotations.cpp | 6 ++++-- unittests/clangd/Annotations.h | 9 ++++++--- unittests/clangd/SyncAPI.cpp | 3 ++- unittests/clangd/SyncAPI.h | 8 ++++++-- unittests/clangd/TestTU.cpp | 3 ++- unittests/clangd/TestTU.h | 9 ++++++--- 36 files changed, 113 insertions(+), 78 deletions(-) diff --git a/clangd/ClangdLSPServer.cpp b/clangd/ClangdLSPServer.cpp index 0d3023be..f71e3618 100644 --- a/clangd/ClangdLSPServer.cpp +++ b/clangd/ClangdLSPServer.cpp @@ -5,7 +5,7 @@ // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "ClangdLSPServer.h" #include "Diagnostics.h" diff --git a/clangd/ClangdLSPServer.h b/clangd/ClangdLSPServer.h index e4cbe500..1d6252da 100644 --- a/clangd/ClangdLSPServer.h +++ b/clangd/ClangdLSPServer.h @@ -5,7 +5,7 @@ // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H @@ -172,4 +172,4 @@ private: } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H diff --git a/clangd/ClangdUnit.cpp b/clangd/ClangdUnit.cpp index 86e7497a..ecb597ca 100644 --- a/clangd/ClangdUnit.cpp +++ b/clangd/ClangdUnit.cpp @@ -1,11 +1,11 @@ -//===--- ClangdUnit.cpp -----------------------------------------*- C++-*-===// +//===--- ClangdUnit.cpp ------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "ClangdUnit.h" #include "Compiler.h" diff --git a/clangd/ClangdUnit.h b/clangd/ClangdUnit.h index c7aca17e..0b12fb1c 100644 --- a/clangd/ClangdUnit.h +++ b/clangd/ClangdUnit.h @@ -1,11 +1,11 @@ -//===--- ClangdUnit.h -------------------------------------------*- C++-*-===// +//===--- ClangdUnit.h --------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H @@ -168,4 +168,5 @@ void dumpAST(ParsedAST &AST, llvm::raw_ostream &OS); } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H diff --git a/clangd/CodeComplete.cpp b/clangd/CodeComplete.cpp index 72e395f1..f603d1a8 100644 --- a/clangd/CodeComplete.cpp +++ b/clangd/CodeComplete.cpp @@ -1,11 +1,11 @@ -//===--- CodeComplete.cpp ---------------------------------------*- C++-*-===// +//===--- CodeComplete.cpp ----------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Code completion has several moving parts: // - AST-based completions are provided using the completion hooks in Sema. @@ -16,7 +16,7 @@ // Signature help works in a similar way as code completion, but it is simpler: // it's purely AST-based, and there are few candidates. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "CodeComplete.h" #include "AST.h" diff --git a/clangd/CodeComplete.h b/clangd/CodeComplete.h index 542d4785..227b49f0 100644 --- a/clangd/CodeComplete.h +++ b/clangd/CodeComplete.h @@ -1,17 +1,18 @@ -//===--- CodeComplete.h -----------------------------------------*- C++-*-===// +//===--- CodeComplete.h ------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Code completion provides suggestions for what the user might type next. // After "std::string S; S." we might suggest members of std::string. // Signature help describes the parameters of a function as you type them. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H @@ -192,4 +193,4 @@ bool isIndexedForCodeCompletion(const NamedDecl &ND, ASTContext &ASTCtx); } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H diff --git a/clangd/CodeCompletionStrings.cpp b/clangd/CodeCompletionStrings.cpp index e601e035..e0277000 100644 --- a/clangd/CodeCompletionStrings.cpp +++ b/clangd/CodeCompletionStrings.cpp @@ -5,7 +5,7 @@ // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "CodeCompletionStrings.h" #include "clang/AST/ASTContext.h" diff --git a/clangd/CodeCompletionStrings.h b/clangd/CodeCompletionStrings.h index dac4ba56..7b66c5c9 100644 --- a/clangd/CodeCompletionStrings.h +++ b/clangd/CodeCompletionStrings.h @@ -5,12 +5,13 @@ // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Functions for retrieving code completion information from // `CodeCompletionString`. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETIONSTRINGS_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETIONSTRINGS_H @@ -70,4 +71,4 @@ std::string getReturnType(const CodeCompletionString &CCS); } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETIONSTRINGS_H diff --git a/clangd/Compiler.cpp b/clangd/Compiler.cpp index 8fcc9a97..9c7a59b4 100644 --- a/clangd/Compiler.cpp +++ b/clangd/Compiler.cpp @@ -1,11 +1,11 @@ -//===--- Compiler.cpp -------------------------------------------*- C++-*-===// +//===--- Compiler.cpp --------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "Compiler.h" #include "Logger.h" diff --git a/clangd/Compiler.h b/clangd/Compiler.h index ce058ad2..49c1c90c 100644 --- a/clangd/Compiler.h +++ b/clangd/Compiler.h @@ -1,17 +1,18 @@ -//===--- Compiler.h ---------------------------------------------*- C++-*-===// +//===--- Compiler.h ----------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Shared utilities for invoking the clang compiler. // ClangdUnit takes care of much of this, but some features like CodeComplete // run their own compile actions that share logic. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_COMPILER_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_COMPILER_H @@ -50,4 +51,4 @@ std::unique_ptr prepareCompilerInstance( } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_COMPILER_H diff --git a/clangd/Context.cpp b/clangd/Context.cpp index 1a9ef24f..66654c47 100644 --- a/clangd/Context.cpp +++ b/clangd/Context.cpp @@ -1,11 +1,11 @@ -//===--- Context.cpp -----------------------------------------*- C++-*-===// +//===--- Context.cpp ---------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "Context.h" #include diff --git a/clangd/Diagnostics.cpp b/clangd/Diagnostics.cpp index 3c293dde..c053bd22 100644 --- a/clangd/Diagnostics.cpp +++ b/clangd/Diagnostics.cpp @@ -1,11 +1,11 @@ -//===--- Diagnostics.cpp ----------------------------------------*- C++-*-===// +//===--- Diagnostics.cpp -----------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "Diagnostics.h" #include "Compiler.h" diff --git a/clangd/Diagnostics.h b/clangd/Diagnostics.h index a08b9fe0..0370bd36 100644 --- a/clangd/Diagnostics.h +++ b/clangd/Diagnostics.h @@ -1,11 +1,11 @@ -//===--- Diagnostics.h ------------------------------------------*- C++-*-===// +//===--- Diagnostics.h -------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIAGNOSTICS_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIAGNOSTICS_H @@ -101,4 +101,4 @@ private: } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIAGNOSTICS_H diff --git a/clangd/GlobalCompilationDatabase.cpp b/clangd/GlobalCompilationDatabase.cpp index 3bfc4eca..6ed236e9 100644 --- a/clangd/GlobalCompilationDatabase.cpp +++ b/clangd/GlobalCompilationDatabase.cpp @@ -1,11 +1,11 @@ -//===--- GlobalCompilationDatabase.cpp --------------------------*- C++-*-===// +//===--- GlobalCompilationDatabase.cpp ---------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "GlobalCompilationDatabase.h" #include "Logger.h" diff --git a/clangd/GlobalCompilationDatabase.h b/clangd/GlobalCompilationDatabase.h index b64028fc..70e79041 100644 --- a/clangd/GlobalCompilationDatabase.h +++ b/clangd/GlobalCompilationDatabase.h @@ -1,11 +1,11 @@ -//===--- GlobalCompilationDatabase.h ----------------------------*- C++-*-===// +//===--- GlobalCompilationDatabase.h -----------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H @@ -139,4 +139,4 @@ private: } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H diff --git a/clangd/Quality.cpp b/clangd/Quality.cpp index f96b50e2..5a9fcd2d 100644 --- a/clangd/Quality.cpp +++ b/clangd/Quality.cpp @@ -1,11 +1,11 @@ -//===--- Quality.cpp --------------------------------------------*- C++-*-===// +//===--- Quality.cpp ---------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "Quality.h" #include "FileDistance.h" #include "URI.h" diff --git a/clangd/Quality.h b/clangd/Quality.h index 86e21963..fda90560 100644 --- a/clangd/Quality.h +++ b/clangd/Quality.h @@ -1,11 +1,11 @@ -//===--- Quality.h - Ranking alternatives for ambiguous queries -*- C++-*-===// +//===--- Quality.h - Ranking alternatives for ambiguous queries --*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// /// /// Some operations such as code completion produce a set of candidates. /// Usually the user can choose between them, but we should put the best options @@ -23,21 +23,27 @@ /// - sorting utilities like the TopN container. /// These could be split up further to isolate dependencies if we care. /// -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_QUALITY_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_QUALITY_H + #include "clang/Sema/CodeCompleteConsumer.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" #include #include #include + namespace llvm { class raw_ostream; } + namespace clang { class CodeCompletionResult; + namespace clangd { + struct Symbol; class URIDistance; @@ -176,4 +182,4 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &, } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_QUALITY_H diff --git a/clangd/XRefs.cpp b/clangd/XRefs.cpp index f5e2b1e1..a79a8d11 100644 --- a/clangd/XRefs.cpp +++ b/clangd/XRefs.cpp @@ -1,11 +1,11 @@ -//===--- XRefs.cpp ----------------------------------------------*- C++-*-===// +//===--- XRefs.cpp -----------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "XRefs.h" #include "AST.h" #include "Logger.h" diff --git a/clangd/XRefs.h b/clangd/XRefs.h index d698a61c..30b53195 100644 --- a/clangd/XRefs.h +++ b/clangd/XRefs.h @@ -1,15 +1,16 @@ -//===--- XRefs.h ------------------------------------------------*- C++-*-===// +//===--- XRefs.h -------------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Features that traverse references between symbols. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H @@ -35,4 +36,5 @@ llvm::Optional getHover(ParsedAST &AST, Position Pos); } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H diff --git a/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp b/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp index 0cc04802..a9f1f98c 100644 --- a/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp +++ b/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp @@ -11,7 +11,7 @@ // whole project. This tools is for **experimental** only. Don't use it in // production code. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "index/CanonicalIncludes.h" #include "index/Index.h" diff --git a/clangd/index/CanonicalIncludes.h b/clangd/index/CanonicalIncludes.h index a2fdb04e..2488f565 100644 --- a/clangd/index/CanonicalIncludes.h +++ b/clangd/index/CanonicalIncludes.h @@ -15,7 +15,7 @@ // We have a lookup table for common standard library implementations. // libstdc++ puts char_traits in bits/char_traits.h, but we #include . // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_CANONICALINCLUDES_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_CANONICALINCLUDES_H diff --git a/clangd/index/FileIndex.h b/clangd/index/FileIndex.h index 35c9f7ef..59bf58c6 100644 --- a/clangd/index/FileIndex.h +++ b/clangd/index/FileIndex.h @@ -11,7 +11,7 @@ // maintained at source-file granuality (e.g. with ASTs), and files can be // updated dynamically. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_FILEINDEX_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_FILEINDEX_H diff --git a/clangd/index/Index.h b/clangd/index/Index.h index 6d63335d..4ae5cd32 100644 --- a/clangd/index/Index.h +++ b/clangd/index/Index.h @@ -1,11 +1,11 @@ -//===--- Index.h ------------------------------------------------*- C++-*-===// +//===--- Index.h -------------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_H @@ -386,4 +386,5 @@ public: } // namespace clangd } // namespace clang + #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_H diff --git a/clangd/index/Merge.cpp b/clangd/index/Merge.cpp index 58d15648..4834bfba 100644 --- a/clangd/index/Merge.cpp +++ b/clangd/index/Merge.cpp @@ -1,18 +1,21 @@ -//===--- Merge.h ------------------------------------------------*- C++-*-===// +//===--- Merge.cpp -----------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #include "Merge.h" #include "../Logger.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/raw_ostream.h" + namespace clang { namespace clangd { namespace { + using namespace llvm; class MergedIndex : public SymbolIndex { @@ -131,5 +134,6 @@ std::unique_ptr mergeIndex(const SymbolIndex *Dynamic, const SymbolIndex *Static) { return llvm::make_unique(Dynamic, Static); } + } // namespace clangd } // namespace clang diff --git a/clangd/index/Merge.h b/clangd/index/Merge.h index b9b58fd9..48c3bc6c 100644 --- a/clangd/index/Merge.h +++ b/clangd/index/Merge.h @@ -1,14 +1,17 @@ -//===--- Merge.h ------------------------------------------------*- C++-*-===// +//===--- Merge.h -------------------------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_MERGE_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_MERGE_H + #include "Index.h" + namespace clang { namespace clangd { @@ -26,4 +29,5 @@ std::unique_ptr mergeIndex(const SymbolIndex *Dynamic, } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_MERGE_H diff --git a/clangd/index/SymbolYAML.h b/clangd/index/SymbolYAML.h index 726af6c6..a4b945c3 100644 --- a/clangd/index/SymbolYAML.h +++ b/clangd/index/SymbolYAML.h @@ -13,7 +13,7 @@ // // This is for **experimental** only. Don't use it in the production code. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOL_FROM_YAML_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_SYMBOL_FROM_YAML_H diff --git a/clangd/index/dex/Iterator.h b/clangd/index/dex/Iterator.h index 317b5496..1616e868 100644 --- a/clangd/index/dex/Iterator.h +++ b/clangd/index/dex/Iterator.h @@ -158,4 +158,4 @@ void populateChildren(std::vector> &Children, } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_DEX_ITERATOR_H diff --git a/clangd/index/dex/Token.h b/clangd/index/dex/Token.h index 33a16d36..f31368cb 100644 --- a/clangd/index/dex/Token.h +++ b/clangd/index/dex/Token.h @@ -109,4 +109,4 @@ template <> struct DenseMapInfo { } // namespace llvm -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_DEX_TOKEN_H diff --git a/clangd/index/dex/Trigram.h b/clangd/index/dex/Trigram.h index 00614edf..a3fc6b32 100644 --- a/clangd/index/dex/Trigram.h +++ b/clangd/index/dex/Trigram.h @@ -69,4 +69,4 @@ std::vector generateQueryTrigrams(llvm::StringRef Query); } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_DEX_TRIGRAM_H diff --git a/modularize/ModuleAssistant.cpp b/modularize/ModuleAssistant.cpp index 7f1cb156..33dca788 100644 --- a/modularize/ModuleAssistant.cpp +++ b/modularize/ModuleAssistant.cpp @@ -1,11 +1,11 @@ -//===--- ModuleAssistant.cpp - Module map generation manager -*- C++ -*---===// +//===--- ModuleAssistant.cpp - Module map generation manager --*- C++ -*---===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This file defines the module generation entry point function, // createModuleMap, a Module class for representing a module, @@ -27,7 +27,7 @@ // map file using a stream obtained and managed by an // llvm::ToolOutputFile object. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "Modularize.h" #include "llvm/ADT/SmallString.h" diff --git a/unittests/clangd/Annotations.cpp b/unittests/clangd/Annotations.cpp index 6bd81c81..bf71a96f 100644 --- a/unittests/clangd/Annotations.cpp +++ b/unittests/clangd/Annotations.cpp @@ -1,16 +1,18 @@ -//===--- Annotations.cpp - Annotated source code for unit tests -*- C++-*-===// +//===--- Annotations.cpp - Annotated source code for unit tests --*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #include "Annotations.h" #include "SourceCode.h" namespace clang { namespace clangd { + using namespace llvm; // Crash if the assertion fails, printing the message and testcase. diff --git a/unittests/clangd/Annotations.h b/unittests/clangd/Annotations.h index 549a21e7..4d787c25 100644 --- a/unittests/clangd/Annotations.h +++ b/unittests/clangd/Annotations.h @@ -1,11 +1,11 @@ -//===--- Annotations.h - Annotated source code for tests --------*- C++-*-===// +//===--- Annotations.h - Annotated source code for tests ---------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Annotations lets you mark points and ranges inside source code, for tests: // @@ -27,8 +27,10 @@ // to define general overlapping ranges. // //===---------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_ANNOTATIONS_H #define LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_ANNOTATIONS_H + #include "Protocol.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" @@ -66,4 +68,5 @@ private: } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_ANNOTATIONS_H diff --git a/unittests/clangd/SyncAPI.cpp b/unittests/clangd/SyncAPI.cpp index ae9ece59..a033db93 100644 --- a/unittests/clangd/SyncAPI.cpp +++ b/unittests/clangd/SyncAPI.cpp @@ -5,7 +5,8 @@ // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #include "SyncAPI.h" namespace clang { diff --git a/unittests/clangd/SyncAPI.h b/unittests/clangd/SyncAPI.h index ddf90d81..4bb65c67 100644 --- a/unittests/clangd/SyncAPI.h +++ b/unittests/clangd/SyncAPI.h @@ -5,10 +5,14 @@ // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// +// // This file contains synchronous versions of ClangdServer's async API. We // deliberately don't expose the sync API outside tests to encourage using the // async versions in clangd code. +// +//===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_SYNCAPI_H #define LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_SYNCAPI_H @@ -49,4 +53,4 @@ runDocumentSymbols(ClangdServer &Server, PathRef File); } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_SYNCAPI_H diff --git a/unittests/clangd/TestTU.cpp b/unittests/clangd/TestTU.cpp index b47d9448..c2b97a9a 100644 --- a/unittests/clangd/TestTU.cpp +++ b/unittests/clangd/TestTU.cpp @@ -5,7 +5,8 @@ // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// + #include "TestTU.h" #include "TestFS.h" #include "index/FileIndex.h" diff --git a/unittests/clangd/TestTU.h b/unittests/clangd/TestTU.h index b66159e3..3995219e 100644 --- a/unittests/clangd/TestTU.h +++ b/unittests/clangd/TestTU.h @@ -1,11 +1,11 @@ -//===--- TestTU.h - Scratch source files for testing ------------*- C++-*-===// +//===--- TestTU.h - Scratch source files for testing -------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===---------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Many tests for indexing, code completion etc are most naturally expressed // using code examples. @@ -14,8 +14,10 @@ // AST, particular symbols, etc. // //===---------------------------------------------------------------------===// + #ifndef LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_TESTTU_H #define LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_TESTTU_H + #include "ClangdUnit.h" #include "index/Index.h" #include "gtest/gtest.h" @@ -64,4 +66,5 @@ const NamedDecl &findAnyDecl(ParsedAST &AST, llvm::StringRef Name); } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_TESTTU_H -- cgit v1.2.3