diff options
author | Petr Hosek <phosek@chromium.org> | 2018-04-10 19:55:55 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2018-04-10 19:55:55 +0000 |
commit | 8d612149db286d97fdbe10191c13792f41283211 (patch) | |
tree | 5e118f7da1a322845162ca5b0a12d50237421e13 /clang/lib/Driver/ToolChains/Linux.cpp | |
parent | 5eae06f21d52d4c1366625f3931c554699b761c1 (diff) | |
download | bcm5719-llvm-8d612149db286d97fdbe10191c13792f41283211.tar.gz bcm5719-llvm-8d612149db286d97fdbe10191c13792f41283211.zip |
[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
llvm-svn: 329748
Diffstat (limited to 'clang/lib/Driver/ToolChains/Linux.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Linux.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp index f135c19e540..c9544a39c20 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -775,7 +775,8 @@ static std::string DetectLibcxxIncludePath(StringRef base) { 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() const { 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, |