//===--- GlobalCompilationDatabase.h -----------------------------*- C++-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H #include "ProjectModules.h" #include "support/Function.h" #include "support/Path.h" #include "support/Threading.h" #include "support/ThreadsafeFS.h" #include "clang/Tooling/ArgumentsAdjusters.h" #include "clang/Tooling/CompilationDatabase.h" #include "llvm/ADT/FunctionExtras.h" #include "llvm/ADT/StringMap.h" #include <memory> #include <mutex> #include <optional> #include <vector> namespace clang { namespace clangd { struct ProjectInfo { … }; /// Provides compilation arguments used for parsing C and C++ files. class GlobalCompilationDatabase { … }; // Helper class for implementing GlobalCompilationDatabases that wrap others. class DelegatingCDB : public GlobalCompilationDatabase { … }; /// Gets compile args from tooling::CompilationDatabases built for parent /// directories. class DirectoryBasedGlobalCompilationDatabase : public GlobalCompilationDatabase { … }; /// Extracts system include search path from drivers matching QueryDriverGlobs /// and adds them to the compile flags. /// Returns null when \p QueryDriverGlobs is empty. SystemIncludeExtractorFn; SystemIncludeExtractorFn getSystemIncludeExtractor(llvm::ArrayRef<std::string> QueryDriverGlobs); /// Wraps another compilation database, and supports overriding the commands /// using an in-memory mapping. class OverlayCDB : public DelegatingCDB { … }; } // namespace clangd } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H