#include "CompileCommands.h"
#include "Config.h"
#include "support/Logger.h"
#include "support/Trace.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
#include <iterator>
#include <optional>
#include <string>
#include <vector>
namespace clang {
namespace clangd {
namespace {
std::optional<std::string> queryXcrun(llvm::ArrayRef<llvm::StringRef> Argv) { … }
std::string resolve(std::string Path) { … }
std::string detectClangPath() { … }
std::optional<std::string> detectSysroot() { … }
std::string detectStandardResourceDir() { … }
static std::string resolveDriver(llvm::StringRef Driver, bool FollowSymlink,
std::optional<std::string> ClangPath) { … }
}
CommandMangler CommandMangler::detect() { … }
CommandMangler CommandMangler::forTests() { … }
void CommandMangler::operator()(tooling::CompileCommand &Command,
llvm::StringRef File) const { … }
namespace {
std::pair<unsigned, unsigned> getArgCount(const llvm::opt::Option &Opt) { … }
enum DriverMode : unsigned char { … };
DriverMode getDriverMode(const std::vector<std::string> &Args) { … }
unsigned char getModes(const llvm::opt::Option &Opt) { … }
}
llvm::ArrayRef<ArgStripper::Rule> ArgStripper::rulesFor(llvm::StringRef Arg) { … }
void ArgStripper::strip(llvm::StringRef Arg) { … }
const ArgStripper::Rule *ArgStripper::matchingRule(llvm::StringRef Arg,
unsigned Mode,
unsigned &ArgCount) const { … }
void ArgStripper::process(std::vector<std::string> &Args) const { … }
std::string printArgv(llvm::ArrayRef<llvm::StringRef> Args) { … }
std::string printArgv(llvm::ArrayRef<std::string> Args) { … }
}
}