Go to the documentation of this file.
11 #include "clang/Config/config.h"
14 #include "llvm/Support/Path.h"
15 #include "llvm/Support/VirtualFileSystem.h"
19 using namespace clang;
31 const llvm::Triple &TargetTriple,
32 StringRef SysRoot)
const {
33 if (TargetTriple.getArch() == llvm::Triple::x86) {
38 if (D.
getVFS().exists(SysRoot +
"/lib/i386-gnu"))
44 return TargetTriple.str();
47 static StringRef
getOSLibDir(
const llvm::Triple &Triple,
const ArgList &Args) {
58 if (Triple.getArch() == llvm::Triple::x86)
61 return Triple.isArch32Bit() ?
"lib" :
"lib64";
84 #ifdef ENABLE_LINKER_BUILD_ID
95 if (StringRef(D.
Dir).startswith(SysRoot)) {
113 if (StringRef(D.
Dir).startswith(SysRoot))
129 if (
getArch() == llvm::Triple::x86)
132 llvm_unreachable(
"unsupported architecture");
136 ArgStringList &CC1Args)
const {
140 if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
143 if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
146 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
148 llvm::sys::path::append(
P,
"include");
152 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
156 StringRef CIncludeDirs(C_INCLUDE_DIRS);
157 if (CIncludeDirs !=
"") {
159 CIncludeDirs.split(Dirs,
":");
160 for (StringRef Dir : Dirs) {
162 llvm::sys::path::is_absolute(Dir) ?
"" : StringRef(SysRoot);
176 if (!MultiarchIncludeDir.empty() &&
177 D.
getVFS().exists(SysRoot +
"/usr/include/" + MultiarchIncludeDir))
179 SysRoot +
"/usr/include/" + MultiarchIncludeDir);
190 llvm::opt::ArgStringList &CC1Args)
const {
197 StringRef DebianMultiarch =
206 CmdArgs.push_back(Opt.c_str());
std::string Dir
The path the driver executable was in, as invoked from the command line.
static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args)
std::string ResourceDir
The path to the compiler resource directory.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
llvm::vfs::FileSystem & getVFS() const