16 #include "llvm/Option/ArgList.h" 17 #include "llvm/Support/FileSystem.h" 18 #include "llvm/Support/Path.h" 22 using namespace clang;
27 const llvm::Triple &Triple,
29 :
Linux(D, Triple, Args) {
43 const ArgList &DriverArgs, ArgStringList &CC1Args)
const {
44 if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
49 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
51 llvm::sys::path::append(P,
"include");
55 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
60 for (
const auto &Path : Callback(SelectedMultilib))
74 const std::string InstalledDir(
getDriver().getInstalledDir());
75 std::string SysRootPath =
76 InstalledDir +
"/../sysroot" + SelectedMultilib.
osSuffix();
77 if (llvm::sys::fs::exists(SysRootPath))
85 Arg *A = Args.getLastArg(options::OPT_stdlib_EQ);
87 StringRef
Value = A->getValue();
88 if (Value !=
"libc++")
90 << A->getAsString(Args);
97 const llvm::opt::ArgList &DriverArgs,
98 llvm::opt::ArgStringList &CC1Args)
const {
100 for (std::string Path : Callback(SelectedMultilib)) {
102 if (llvm::sys::fs::exists(Path)) {
111 ArgStringList &CmdArgs)
const {
113 "Only -lc++ (aka libxx) is supported in this toolchain.");
115 CmdArgs.push_back(
"-lc++");
116 CmdArgs.push_back(
"-lc++abi");
117 CmdArgs.push_back(
"-lunwind");
124 llvm::sys::path::append(Path, SelectedMultilib.
osSuffix(),
"lib" + LibSuffix,
126 llvm::sys::path::append(Path, Twine(
"libclang_rt." + Component +
"-" +
127 "mips" + (Shared ?
".so" :
".a")));
const IncludeDirsFunc & includeDirsCallback() const
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.