#include "BareMetal.h"
#include "CommonArgs.h"
#include "Gnu.h"
#include "clang/Driver/InputInfo.h"
#include "Arch/ARM.h"
#include "Arch/RISCV.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/MultilibBuilder.h"
#include "clang/Driver/Options.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <sstream>
usingnamespacellvm::opt;
usingnamespaceclang;
usingnamespaceclang::driver;
usingnamespaceclang::driver::tools;
usingnamespaceclang::driver::toolchains;
static bool findRISCVMultilibs(const Driver &D,
const llvm::Triple &TargetTriple,
const ArgList &Args, DetectedMultilibs &Result) { … }
static std::string computeBaseSysRoot(const Driver &D, bool IncludeTriple) { … }
BareMetal::BareMetal(const Driver &D, const llvm::Triple &Triple,
const ArgList &Args)
: … { … }
static bool isARMBareMetal(const llvm::Triple &Triple) { … }
static bool isAArch64BareMetal(const llvm::Triple &Triple) { … }
static bool isRISCVBareMetal(const llvm::Triple &Triple) { … }
static bool isPPCBareMetal(const llvm::Triple &Triple) { … }
static void findMultilibsFromYAML(const ToolChain &TC, const Driver &D,
StringRef MultilibPath, const ArgList &Args,
DetectedMultilibs &Result) { … }
static constexpr llvm::StringLiteral MultilibFilename = …;
static std::optional<llvm::SmallString<128>>
getMultilibConfigPath(const Driver &D, const llvm::Triple &Triple,
const ArgList &Args) { … }
void BareMetal::findMultilibs(const Driver &D, const llvm::Triple &Triple,
const ArgList &Args) { … }
bool BareMetal::handlesTarget(const llvm::Triple &Triple) { … }
Tool *BareMetal::buildLinker() const { … }
Tool *BareMetal::buildStaticLibTool() const { … }
std::string BareMetal::computeSysRoot() const { … }
BareMetal::OrderedMultilibs BareMetal::getOrderedMultilibs() const { … }
void BareMetal::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const { … }
void BareMetal::addClangTargetOptions(const ArgList &DriverArgs,
ArgStringList &CC1Args,
Action::OffloadKind) const { … }
void BareMetal::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const { … }
void BareMetal::AddCXXStdlibLibArgs(const ArgList &Args,
ArgStringList &CmdArgs) const { … }
void BareMetal::AddLinkRuntimeLib(const ArgList &Args,
ArgStringList &CmdArgs) const { … }
void baremetal::StaticLibTool::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
const ArgList &Args,
const char *LinkingOutput) const { … }
void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
const ArgList &Args,
const char *LinkingOutput) const { … }
SanitizerMask BareMetal::getSupportedSanitizers() const { … }