Index: clang-tools-extra/clangd/ClangdLSPServer.h =================================================================== --- clang-tools-extra/clangd/ClangdLSPServer.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H Index: clang-tools-extra/clangd/ClangdLSPServer.cpp =================================================================== --- clang-tools-extra/clangd/ClangdLSPServer.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/ClangdUnit.h =================================================================== --- clang-tools-extra/clangd/ClangdUnit.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H Index: clang-tools-extra/clangd/ClangdUnit.cpp =================================================================== --- clang-tools-extra/clangd/ClangdUnit.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/CodeComplete.h =================================================================== --- clang-tools-extra/clangd/CodeComplete.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H Index: clang-tools-extra/clangd/CodeComplete.cpp =================================================================== --- clang-tools-extra/clangd/CodeComplete.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/CodeCompletionStrings.h =================================================================== --- clang-tools-extra/clangd/CodeCompletionStrings.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETIONSTRINGS_H Index: clang-tools-extra/clangd/CodeCompletionStrings.cpp =================================================================== --- clang-tools-extra/clangd/CodeCompletionStrings.cpp +++ clang-tools-extra/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" @@ -66,7 +66,8 @@ // Sanity check that the comment does not come from the PCH. We choose to not // write them into PCH, because they are racy and slow to load. assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc())); - std::string Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics()); + std::string Doc = + RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics()); if (!looksLikeDocComment(Doc)) return ""; return Doc; @@ -85,7 +86,8 @@ // Sanity check that the comment does not come from the PCH. We choose to not // write them into PCH, because they are racy and slow to load. assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc())); - std::string Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics()); + std::string Doc = + RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics()); if (!looksLikeDocComment(Doc)) return ""; return Doc; Index: clang-tools-extra/clangd/Compiler.h =================================================================== --- clang-tools-extra/clangd/Compiler.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_COMPILER_H Index: clang-tools-extra/clangd/Compiler.cpp =================================================================== --- clang-tools-extra/clangd/Compiler.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/Context.cpp =================================================================== --- clang-tools-extra/clangd/Context.cpp +++ clang-tools-extra/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 Index: clang-tools-extra/clangd/Diagnostics.h =================================================================== --- clang-tools-extra/clangd/Diagnostics.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIAGNOSTICS_H Index: clang-tools-extra/clangd/Diagnostics.cpp =================================================================== --- clang-tools-extra/clangd/Diagnostics.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/GlobalCompilationDatabase.h =================================================================== --- clang-tools-extra/clangd/GlobalCompilationDatabase.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H Index: clang-tools-extra/clangd/GlobalCompilationDatabase.cpp =================================================================== --- clang-tools-extra/clangd/GlobalCompilationDatabase.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/Quality.h =================================================================== --- clang-tools-extra/clangd/Quality.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_QUALITY_H Index: clang-tools-extra/clangd/Quality.cpp =================================================================== --- clang-tools-extra/clangd/Quality.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/XRefs.h =================================================================== --- clang-tools-extra/clangd/XRefs.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H Index: clang-tools-extra/clangd/XRefs.cpp =================================================================== --- clang-tools-extra/clangd/XRefs.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp =================================================================== --- clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp +++ clang-tools-extra/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" Index: clang-tools-extra/clangd/index/CanonicalIncludes.h =================================================================== --- clang-tools-extra/clangd/index/CanonicalIncludes.h +++ clang-tools-extra/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 Index: clang-tools-extra/clangd/index/FileIndex.h =================================================================== --- clang-tools-extra/clangd/index/FileIndex.h +++ clang-tools-extra/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 Index: clang-tools-extra/clangd/index/Index.h =================================================================== --- clang-tools-extra/clangd/index/Index.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang + #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_H Index: clang-tools-extra/clangd/index/Merge.h =================================================================== --- clang-tools-extra/clangd/index/Merge.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_MERGE_H Index: clang-tools-extra/clangd/index/Merge.cpp =================================================================== --- clang-tools-extra/clangd/index/Merge.cpp +++ clang-tools-extra/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 @@ const SymbolIndex *Static) { return llvm::make_unique(Dynamic, Static); } + } // namespace clangd } // namespace clang Index: clang-tools-extra/clangd/index/SymbolYAML.h =================================================================== --- clang-tools-extra/clangd/index/SymbolYAML.h +++ clang-tools-extra/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 Index: clang-tools-extra/clangd/index/dex/Iterator.h =================================================================== --- clang-tools-extra/clangd/index/dex/Iterator.h +++ clang-tools-extra/clangd/index/dex/Iterator.h @@ -158,4 +158,4 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_DEX_ITERATOR_H Index: clang-tools-extra/clangd/index/dex/Token.h =================================================================== --- clang-tools-extra/clangd/index/dex/Token.h +++ clang-tools-extra/clangd/index/dex/Token.h @@ -109,4 +109,4 @@ } // namespace llvm -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_DEX_TOKEN_H Index: clang-tools-extra/clangd/index/dex/Trigram.h =================================================================== --- clang-tools-extra/clangd/index/dex/Trigram.h +++ clang-tools-extra/clangd/index/dex/Trigram.h @@ -69,4 +69,4 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_DEX_TRIGRAM_H Index: clang-tools-extra/modularize/ModuleAssistant.cpp =================================================================== --- clang-tools-extra/modularize/ModuleAssistant.cpp +++ clang-tools-extra/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" @@ -64,7 +64,7 @@ // Constructors. Module::Module(llvm::StringRef Name, bool Problem) - : Name(Name), IsProblem(Problem) {} + : Name(Name), IsProblem(Problem) {} Module::Module() : IsProblem(false) {} // Destructor. @@ -133,9 +133,9 @@ // Keep in sync with keywords in module map parser in Lex/ModuleMap.cpp, // such as in ModuleMapParser::consumeToken(). static const char *const ReservedNames[] = { - "config_macros", "export", "module", "conflict", "framework", - "requires", "exclude", "header", "private", "explicit", - "link", "umbrella", "extern", "use", nullptr // Flag end. + "config_macros", "export", "module", "conflict", "framework", + "requires", "exclude", "header", "private", "explicit", + "link", "umbrella", "extern", "use", nullptr // Flag end. }; // Convert module name to a non-keyword. @@ -154,8 +154,7 @@ // Convert module name to a non-keyword. // Prepends a '_' to the name if and only if the name is a keyword. -static std::string -ensureVaidModuleName(llvm::StringRef MightBeInvalidName) { +static std::string ensureVaidModuleName(llvm::StringRef MightBeInvalidName) { std::string SafeName = MightBeInvalidName; std::replace(SafeName.begin(), SafeName.end(), '-', '_'); std::replace(SafeName.begin(), SafeName.end(), '.', '_'); @@ -218,8 +217,8 @@ // Create the internal module tree representation. static Module *loadModuleDescriptions( llvm::StringRef RootModuleName, llvm::ArrayRef HeaderFileNames, - llvm::ArrayRef ProblemFileNames, - DependencyMap &Dependencies, llvm::StringRef HeaderPrefix) { + llvm::ArrayRef ProblemFileNames, DependencyMap &Dependencies, + llvm::StringRef HeaderPrefix) { // Create root module. auto *RootModule = new Module(RootModuleName, false); @@ -244,7 +243,8 @@ } } // Add as a module. - if (!addModuleDescription(RootModule, Header, HeaderPrefix, Dependencies, IsProblemFile)) + if (!addModuleDescription(RootModule, Header, HeaderPrefix, Dependencies, + IsProblemFile)) return nullptr; } @@ -305,9 +305,8 @@ llvm::StringRef RootModuleName) { // Load internal representation of modules. std::unique_ptr RootModule( - loadModuleDescriptions( - RootModuleName, HeaderFileNames, ProblemFileNames, Dependencies, - HeaderPrefix)); + loadModuleDescriptions(RootModuleName, HeaderFileNames, ProblemFileNames, + Dependencies, HeaderPrefix)); if (!RootModule.get()) return false; Index: clang-tools-extra/unittests/clangd/Annotations.h =================================================================== --- clang-tools-extra/unittests/clangd/Annotations.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_ANNOTATIONS_H Index: clang-tools-extra/unittests/clangd/Annotations.cpp =================================================================== --- clang-tools-extra/unittests/clangd/Annotations.cpp +++ clang-tools-extra/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. Index: clang-tools-extra/unittests/clangd/SyncAPI.h =================================================================== --- clang-tools-extra/unittests/clangd/SyncAPI.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif +#endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_SYNCAPI_H Index: clang-tools-extra/unittests/clangd/SyncAPI.cpp =================================================================== --- clang-tools-extra/unittests/clangd/SyncAPI.cpp +++ clang-tools-extra/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 { Index: clang-tools-extra/unittests/clangd/TestTU.h =================================================================== --- clang-tools-extra/unittests/clangd/TestTU.h +++ clang-tools-extra/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 @@ } // namespace clangd } // namespace clang -#endif + +#endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_TESTTU_H Index: clang-tools-extra/unittests/clangd/TestTU.cpp =================================================================== --- clang-tools-extra/unittests/clangd/TestTU.cpp +++ clang-tools-extra/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"