#include "CompileCommands.h"
#include "GlobalCompilationDatabase.h"
#include "support/Logger.h"
#include "support/Threading.h"
#include "support/Trace.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Driver/Types.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstddef>
#include <iterator>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
namespace clang::clangd {
namespace {
struct DriverInfo { … };
struct DriverArgs { … };
}
}
namespace llvm {
DriverArgs;
template <> struct DenseMapInfo<DriverArgs> { … };
}
namespace clang::clangd {
namespace {
bool isValidTarget(llvm::StringRef Triple) { … }
std::optional<DriverInfo> parseDriverOutput(llvm::StringRef Output) { … }
std::optional<std::string> run(llvm::ArrayRef<llvm::StringRef> Argv,
bool OutputIsStderr) { … }
std::optional<DriverInfo>
extractSystemIncludesAndTarget(const DriverArgs &InputArgs,
const llvm::Regex &QueryDriverRegex) { … }
tooling::CompileCommand &
addSystemIncludes(tooling::CompileCommand &Cmd,
llvm::ArrayRef<std::string> SystemIncludes) { … }
tooling::CompileCommand &setTarget(tooling::CompileCommand &Cmd,
const std::string &Target) { … }
std::string convertGlobToRegex(llvm::StringRef Glob) { … }
llvm::Regex convertGlobsToRegex(llvm::ArrayRef<std::string> Globs) { … }
class SystemIncludeExtractor { … };
}
SystemIncludeExtractorFn
getSystemIncludeExtractor(llvm::ArrayRef<std::string> QueryDriverGlobs) { … }
}