#include "GlobalCompilationDatabase.h"
#include "Config.h"
#include "FS.h"
#include "ProjectModules.h"
#include "ScanningProjectModules.h"
#include "SourceCode.h"
#include "support/Logger.h"
#include "support/Path.h"
#include "support/Threading.h"
#include "support/ThreadsafeFS.h"
#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/CompilationDatabasePluginRegistry.h"
#include "clang/Tooling/JSONCompilationDatabase.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/TargetParser/Host.h"
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <deque>
#include <mutex>
#include <optional>
#include <string>
#include <tuple>
#include <vector>
namespace clang {
namespace clangd {
namespace {
void actOnAllParentDirectories(PathRef FileName,
llvm::function_ref<bool(PathRef)> Action) { … }
}
tooling::CompileCommand
GlobalCompilationDatabase::getFallbackCommand(PathRef File) const { … }
class DirectoryBasedGlobalCompilationDatabase::DirectoryCache { … };
DirectoryBasedGlobalCompilationDatabase::DirectoryCache::CachedFile::LoadResult
DirectoryBasedGlobalCompilationDatabase::DirectoryCache::CachedFile::load(
llvm::vfs::FileSystem &FS, bool HasOldData) { … }
static std::unique_ptr<tooling::CompilationDatabase>
parseJSON(PathRef Path, llvm::StringRef Data, std::string &Error) { … }
static std::unique_ptr<tooling::CompilationDatabase>
parseFixed(PathRef Path, llvm::StringRef Data, std::string &Error) { … }
bool DirectoryBasedGlobalCompilationDatabase::DirectoryCache::load(
llvm::vfs::FileSystem &FS) { … }
DirectoryBasedGlobalCompilationDatabase::
DirectoryBasedGlobalCompilationDatabase(const Options &Opts)
: … { … }
DirectoryBasedGlobalCompilationDatabase::
~DirectoryBasedGlobalCompilationDatabase() = default;
std::optional<tooling::CompileCommand>
DirectoryBasedGlobalCompilationDatabase::getCompileCommand(PathRef File) const { … }
std::vector<DirectoryBasedGlobalCompilationDatabase::DirectoryCache *>
DirectoryBasedGlobalCompilationDatabase::getDirectoryCaches(
llvm::ArrayRef<llvm::StringRef> Dirs) const { … }
std::optional<DirectoryBasedGlobalCompilationDatabase::CDBLookupResult>
DirectoryBasedGlobalCompilationDatabase::lookupCDB(
CDBLookupRequest Request) const { … }
class DirectoryBasedGlobalCompilationDatabase::BroadcastThread { … };
class DirectoryBasedGlobalCompilationDatabase::BroadcastThread::Filter { … };
void DirectoryBasedGlobalCompilationDatabase::BroadcastThread::process(
const CDBLookupResult &T) { … }
void DirectoryBasedGlobalCompilationDatabase::broadcastCDB(
CDBLookupResult Result) const { … }
bool DirectoryBasedGlobalCompilationDatabase::blockUntilIdle(
Deadline Timeout) const { … }
std::optional<ProjectInfo>
DirectoryBasedGlobalCompilationDatabase::getProjectInfo(PathRef File) const { … }
std::unique_ptr<ProjectModules>
DirectoryBasedGlobalCompilationDatabase::getProjectModules(PathRef File) const { … }
OverlayCDB::OverlayCDB(const GlobalCompilationDatabase *Base,
std::vector<std::string> FallbackFlags,
CommandMangler Mangler)
: … { … }
std::optional<tooling::CompileCommand>
OverlayCDB::getCompileCommand(PathRef File) const { … }
tooling::CompileCommand OverlayCDB::getFallbackCommand(PathRef File) const { … }
void OverlayCDB::setCompileCommand(PathRef File,
std::optional<tooling::CompileCommand> Cmd) { … }
DelegatingCDB::DelegatingCDB(const GlobalCompilationDatabase *Base)
: … { … }
DelegatingCDB::DelegatingCDB(std::unique_ptr<GlobalCompilationDatabase> Base)
: … { … }
std::optional<tooling::CompileCommand>
DelegatingCDB::getCompileCommand(PathRef File) const { … }
std::optional<ProjectInfo> DelegatingCDB::getProjectInfo(PathRef File) const { … }
std::unique_ptr<ProjectModules>
DelegatingCDB::getProjectModules(PathRef File) const { … }
tooling::CompileCommand DelegatingCDB::getFallbackCommand(PathRef File) const { … }
bool DelegatingCDB::blockUntilIdle(Deadline D) const { … }
}
}