r329748 - [Driver] Allow drivers to add multiple libc++ include paths
Petr Hosek via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 10 12:55:55 PDT 2018
Author: phosek
Date: Tue Apr 10 12:55:55 2018
New Revision: 329748
URL: http://llvm.org/viewvc/llvm-project?rev=329748&view=rev
Log:
[Driver] Allow drivers to add multiple libc++ include paths
This allows toolchain drivers to add multiple libc++ include paths akin
to libstdc++. This is useful in multiarch setup when some headers might
be in target specific include directory. There should be no functional
change.
Differential Revision: https://reviews.llvm.org/D45422
Modified:
cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
cfe/trunk/lib/Driver/ToolChains/BareMetal.h
cfe/trunk/lib/Driver/ToolChains/CloudABI.cpp
cfe/trunk/lib/Driver/ToolChains/CloudABI.h
cfe/trunk/lib/Driver/ToolChains/Contiki.h
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
cfe/trunk/lib/Driver/ToolChains/Gnu.h
cfe/trunk/lib/Driver/ToolChains/Haiku.cpp
cfe/trunk/lib/Driver/ToolChains/Haiku.h
cfe/trunk/lib/Driver/ToolChains/Lanai.h
cfe/trunk/lib/Driver/ToolChains/Linux.cpp
cfe/trunk/lib/Driver/ToolChains/Linux.h
cfe/trunk/lib/Driver/ToolChains/MipsLinux.cpp
cfe/trunk/lib/Driver/ToolChains/MipsLinux.h
cfe/trunk/lib/Driver/ToolChains/Myriad.cpp
cfe/trunk/lib/Driver/ToolChains/Myriad.h
cfe/trunk/lib/Driver/ToolChains/NaCl.cpp
cfe/trunk/lib/Driver/ToolChains/NaCl.h
cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
cfe/trunk/lib/Driver/ToolChains/NetBSD.h
cfe/trunk/lib/Driver/ToolChains/PS4CPU.h
Modified: cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp Tue Apr 10 12:55:55 2018
@@ -95,16 +95,23 @@ void BareMetal::addClangTargetOptions(co
CC1Args.push_back("-nostdsysteminc");
}
-std::string BareMetal::findLibCxxIncludePath(CXXStdlibType LibType) const {
+void BareMetal::AddClangCXXStdlibIncludeArgs(
+ const ArgList &DriverArgs, ArgStringList &CC1Args) const {
+ if (DriverArgs.hasArg(options::OPT_nostdinc) ||
+ DriverArgs.hasArg(options::OPT_nostdlibinc) ||
+ DriverArgs.hasArg(options::OPT_nostdincxx))
+ return;
+
StringRef SysRoot = getDriver().SysRoot;
if (SysRoot.empty())
- return "";
+ return;
- switch (LibType) {
+ switch (GetCXXStdlibType(DriverArgs)) {
case ToolChain::CST_Libcxx: {
SmallString<128> Dir(SysRoot);
llvm::sys::path::append(Dir, "include", "c++", "v1");
- return Dir.str();
+ addSystemInclude(DriverArgs, CC1Args, Dir.str());
+ break;
}
case ToolChain::CST_Libstdcxx: {
SmallString<128> Dir(SysRoot);
@@ -124,24 +131,12 @@ std::string BareMetal::findLibCxxInclude
Version = CandidateVersion;
}
if (Version.Major == -1)
- return "";
+ return;
llvm::sys::path::append(Dir, Version.Text);
- return Dir.str();
+ addSystemInclude(DriverArgs, CC1Args, Dir.str());
+ break;
}
}
- llvm_unreachable("unhandled LibType");
-}
-
-void BareMetal::AddClangCXXStdlibIncludeArgs(
- const ArgList &DriverArgs, ArgStringList &CC1Args) const {
- if (DriverArgs.hasArg(options::OPT_nostdinc) ||
- DriverArgs.hasArg(options::OPT_nostdlibinc) ||
- DriverArgs.hasArg(options::OPT_nostdincxx))
- return;
-
- std::string Path = findLibCxxIncludePath(GetCXXStdlibType(DriverArgs));
- if (!Path.empty())
- addSystemInclude(DriverArgs, CC1Args, Path);
}
void BareMetal::AddCXXStdlibLibArgs(const ArgList &Args,
Modified: cfe/trunk/lib/Driver/ToolChains/BareMetal.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/BareMetal.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/BareMetal.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/BareMetal.h Tue Apr 10 12:55:55 2018
@@ -53,7 +53,6 @@ public:
void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args,
Action::OffloadKind DeviceOffloadKind) const override;
- std::string findLibCxxIncludePath(ToolChain::CXXStdlibType LibType) const;
void AddClangCXXStdlibIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/CloudABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CloudABI.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/CloudABI.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/CloudABI.cpp Tue Apr 10 12:55:55 2018
@@ -104,10 +104,11 @@ CloudABI::CloudABI(const Driver &D, cons
getFilePaths().push_back(P.str());
}
-std::string CloudABI::findLibCxxIncludePath() const {
+void CloudABI::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
SmallString<128> P(getDriver().Dir);
llvm::sys::path::append(P, "..", getTriple().str(), "include/c++/v1");
- return P.str();
+ addSystemInclude(DriverArgs, CC1Args, P.str());
}
void CloudABI::AddCXXStdlibLibArgs(const ArgList &Args,
Modified: cfe/trunk/lib/Driver/ToolChains/CloudABI.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CloudABI.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/CloudABI.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/CloudABI.h Tue Apr 10 12:55:55 2018
@@ -50,7 +50,9 @@ public:
GetCXXStdlibType(const llvm::opt::ArgList &Args) const override {
return ToolChain::CST_Libcxx;
}
- std::string findLibCxxIncludePath() const override;
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/Contiki.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Contiki.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Contiki.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Contiki.h Tue Apr 10 12:55:55 2018
@@ -23,7 +23,9 @@ public:
const llvm::opt::ArgList &Args);
// No support for finding a C++ standard library yet.
- std::string findLibCxxIncludePath() const override { return ""; }
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override {}
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override {}
Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Tue Apr 10 12:55:55 2018
@@ -2391,12 +2391,9 @@ void Generic_GCC::AddClangCXXStdlibInclu
return;
switch (GetCXXStdlibType(DriverArgs)) {
- case ToolChain::CST_Libcxx: {
- std::string Path = findLibCxxIncludePath();
- if (!Path.empty())
- addSystemInclude(DriverArgs, CC1Args, Path);
+ case ToolChain::CST_Libcxx:
+ addLibCxxIncludePaths(DriverArgs, CC1Args);
break;
- }
case ToolChain::CST_Libstdcxx:
addLibStdCxxIncludePaths(DriverArgs, CC1Args);
@@ -2404,9 +2401,12 @@ void Generic_GCC::AddClangCXXStdlibInclu
}
}
-std::string Generic_GCC::findLibCxxIncludePath() const {
+void
+Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
// FIXME: The Linux behavior would probaby be a better approach here.
- return getDriver().SysRoot + "/usr/include/c++/v1";
+ addSystemInclude(DriverArgs, CC1Args,
+ getDriver().SysRoot + "/usr/include/c++/v1");
}
void
Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Gnu.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.h Tue Apr 10 12:55:55 2018
@@ -316,7 +316,9 @@ protected:
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
- virtual std::string findLibCxxIncludePath() const;
+ virtual void
+ addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const;
virtual void
addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const;
Modified: cfe/trunk/lib/Driver/ToolChains/Haiku.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Haiku.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Haiku.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Haiku.cpp Tue Apr 10 12:55:55 2018
@@ -22,8 +22,10 @@ Haiku::Haiku(const Driver &D, const llvm
}
-std::string Haiku::findLibCxxIncludePath() const {
- return getDriver().SysRoot + "/system/develop/headers/c++/v1";
+void Haiku::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
+ addSystemInclude(DriverArgs, CC1Args,
+ getDriver().SysRoot + "/system/develop/headers/c++/v1");
}
void Haiku::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
Modified: cfe/trunk/lib/Driver/ToolChains/Haiku.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Haiku.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Haiku.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Haiku.h Tue Apr 10 12:55:55 2018
@@ -27,7 +27,9 @@ public:
return getTriple().getArch() == llvm::Triple::x86_64;
}
- std::string findLibCxxIncludePath() const override;
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/Lanai.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Lanai.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Lanai.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Lanai.h Tue Apr 10 12:55:55 2018
@@ -24,7 +24,9 @@ public:
: Generic_ELF(D, Triple, Args) {}
// No support for finding a C++ standard library yet.
- std::string findLibCxxIncludePath() const override { return ""; }
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override {}
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override {}
Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Tue Apr 10 12:55:55 2018
@@ -775,7 +775,8 @@ static std::string DetectLibcxxIncludePa
return MaxVersion ? (base + "/" + MaxVersionString).str() : "";
}
-std::string Linux::findLibCxxIncludePath() const {
+void Linux::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
const std::string LibCXXIncludePathCandidates[] = {
DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"),
// If this is a development, non-installed, clang, libcxx will
@@ -787,9 +788,9 @@ std::string Linux::findLibCxxIncludePath
if (IncludePath.empty() || !getVFS().exists(IncludePath))
continue;
// Use the first candidate that exists.
- return IncludePath;
+ addSystemInclude(DriverArgs, CC1Args, IncludePath);
+ return;
}
- return "";
}
void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
Modified: cfe/trunk/lib/Driver/ToolChains/Linux.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Linux.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Linux.h Tue Apr 10 12:55:55 2018
@@ -27,7 +27,9 @@ public:
void
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
- std::string findLibCxxIncludePath() const override;
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/MipsLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MipsLinux.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/MipsLinux.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/MipsLinux.cpp Tue Apr 10 12:55:55 2018
@@ -94,16 +94,18 @@ MipsLLVMToolChain::GetCXXStdlibType(cons
return ToolChain::CST_Libcxx;
}
-std::string MipsLLVMToolChain::findLibCxxIncludePath() const {
+void MipsLLVMToolChain::addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
if (const auto &Callback = Multilibs.includeDirsCallback()) {
for (std::string Path : Callback(SelectedMultilib)) {
Path = getDriver().getInstalledDir() + Path + "/c++/v1";
if (llvm::sys::fs::exists(Path)) {
- return Path;
+ addSystemInclude(DriverArgs, CC1Args, Path);
+ return;
}
}
}
- return "";
}
void MipsLLVMToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
Modified: cfe/trunk/lib/Driver/ToolChains/MipsLinux.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MipsLinux.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/MipsLinux.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/MipsLinux.h Tue Apr 10 12:55:55 2018
@@ -31,7 +31,9 @@ public:
CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
- std::string findLibCxxIncludePath() const override;
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/Myriad.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Myriad.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Myriad.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Myriad.cpp Tue Apr 10 12:55:55 2018
@@ -242,9 +242,11 @@ void MyriadToolChain::AddClangSystemIncl
addSystemInclude(DriverArgs, CC1Args, getDriver().SysRoot + "/include");
}
-std::string MyriadToolChain::findLibCxxIncludePath() const {
+void MyriadToolChain::addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
std::string Path(getDriver().getInstalledDir());
- return Path + "/../include/c++/v1";
+ addSystemInclude(DriverArgs, CC1Args, Path + "/../include/c++/v1");
}
void MyriadToolChain::addLibStdCxxIncludePaths(
Modified: cfe/trunk/lib/Driver/ToolChains/Myriad.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Myriad.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Myriad.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Myriad.h Tue Apr 10 12:55:55 2018
@@ -76,7 +76,9 @@ public:
void
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
- std::string findLibCxxIncludePath() const override;
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/NaCl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/NaCl.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/NaCl.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/NaCl.cpp Tue Apr 10 12:55:55 2018
@@ -309,25 +309,29 @@ void NaClToolChain::AddCXXStdlibLibArgs(
CmdArgs.push_back("-lc++");
}
-std::string NaClToolChain::findLibCxxIncludePath() const {
+void NaClToolChain::addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
const Driver &D = getDriver();
SmallString<128> P(D.Dir + "/../");
switch (getTriple().getArch()) {
case llvm::Triple::arm:
llvm::sys::path::append(P, "arm-nacl/include/c++/v1");
- return P.str();
+ addSystemInclude(DriverArgs, CC1Args, P.str());
+ break;
case llvm::Triple::x86:
llvm::sys::path::append(P, "x86_64-nacl/include/c++/v1");
- return P.str();
+ addSystemInclude(DriverArgs, CC1Args, P.str());
+ break;
case llvm::Triple::x86_64:
llvm::sys::path::append(P, "x86_64-nacl/include/c++/v1");
- return P.str();
+ addSystemInclude(DriverArgs, CC1Args, P.str());
+ break;
case llvm::Triple::mipsel:
llvm::sys::path::append(P, "mipsel-nacl/include/c++/v1");
- return P.str();
- default:
- return "";
+ addSystemInclude(DriverArgs, CC1Args, P.str());
+ break;
}
}
Modified: cfe/trunk/lib/Driver/ToolChains/NaCl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/NaCl.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/NaCl.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/NaCl.h Tue Apr 10 12:55:55 2018
@@ -53,7 +53,9 @@ public:
void
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
- std::string findLibCxxIncludePath() const override;
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp Tue Apr 10 12:55:55 2018
@@ -406,8 +406,10 @@ ToolChain::CXXStdlibType NetBSD::GetDefa
return ToolChain::CST_Libstdcxx;
}
-std::string NetBSD::findLibCxxIncludePath() const {
- return getDriver().SysRoot + "/usr/include/c++/";
+void NetBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
+ addSystemInclude(DriverArgs, CC1Args,
+ getDriver().SysRoot + "/usr/include/c++/");
}
void NetBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
Modified: cfe/trunk/lib/Driver/ToolChains/NetBSD.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/NetBSD.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/NetBSD.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/NetBSD.h Tue Apr 10 12:55:55 2018
@@ -60,7 +60,9 @@ public:
CXXStdlibType GetDefaultCXXStdlibType() const override;
- std::string findLibCxxIncludePath() const override;
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
Modified: cfe/trunk/lib/Driver/ToolChains/PS4CPU.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/PS4CPU.h?rev=329748&r1=329747&r2=329748&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/PS4CPU.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/PS4CPU.h Tue Apr 10 12:55:55 2018
@@ -61,7 +61,9 @@ public:
const llvm::opt::ArgList &Args);
// No support for finding a C++ standard library yet.
- std::string findLibCxxIncludePath() const override { return ""; }
+ void addLibCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override {}
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override {}
More information about the cfe-commits
mailing list