15 #include "llvm/Option/ArgList.h" 16 #include "llvm/Support/FileSystem.h" 17 #include "llvm/Support/Path.h" 21 using namespace clang;
26 const llvm::Triple &Triple,
28 :
Linux(D, Triple, Args) {
42 const ArgList &DriverArgs, ArgStringList &CC1Args)
const {
43 if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
48 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
50 llvm::sys::path::append(P,
"include");
54 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
59 for (
const auto &Path : Callback(SelectedMultilib))
73 const std::string InstalledDir(
getDriver().getInstalledDir());
74 std::string SysRootPath =
75 InstalledDir +
"/../sysroot" + SelectedMultilib.
osSuffix();
76 if (llvm::sys::fs::exists(SysRootPath))
84 Arg *A = Args.getLastArg(options::OPT_stdlib_EQ);
86 StringRef
Value = A->getValue();
87 if (Value !=
"libc++")
89 << A->getAsString(Args);
96 const llvm::opt::ArgList &DriverArgs,
97 llvm::opt::ArgStringList &CC1Args)
const {
99 for (std::string Path : Callback(SelectedMultilib)) {
101 if (llvm::sys::fs::exists(Path)) {
110 ArgStringList &CmdArgs)
const {
112 "Only -lc++ (aka libxx) is supported in this toolchain.");
114 CmdArgs.push_back(
"-lc++");
115 CmdArgs.push_back(
"-lc++abi");
116 CmdArgs.push_back(
"-lunwind");
123 llvm::sys::path::append(Path, SelectedMultilib.
osSuffix(),
"lib" + LibSuffix,
137 llvm::sys::path::append(
138 Path, Twine(
"libclang_rt." + Component +
"-" +
"mips" + Suffix));
const IncludeDirsFunc & includeDirsCallback() const
The base class of the type hierarchy.
DiagnosticBuilder Diag(unsigned DiagID) const
const std::string & osSuffix() const
Get the detected os path suffix for the multi-arch target variant.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Dataflow Directional Tag Classes.
std::string SysRoot
sysroot, if present
const char * getInstalledDir() const
Get the path to where the clang executable was installed.
bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const llvm::opt::ArgList &Args, DetectedMultilibs &Result)
MultilibSet Multilibs
The set of multilibs that the detected installation supports.
Multilib SelectedMultilib
The primary multilib appropriate for the given flags.
std::string ResourceDir
The path to the compiler resource directory.