diff options
author | Bob Wilson <bob.wilson@apple.com> | 2011-06-21 21:12:29 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2011-06-21 21:12:29 +0000 |
commit | 13c4f2144b35bda21746eb60ad90e52a9bd8dcda (patch) | |
tree | 322d8fca89a114ca0c217ddc2e779691208caa55 /lib/Frontend/InitHeaderSearch.cpp | |
parent | ee273b3b312642da33dd832125206d30e07fc811 (diff) |
Fix the default libc++ header search path to be sysrooted. Radar 9639692.
The -cxx-isystem path is not prefixed with the sysroot directory, so it's
not a good way for the driver to set the system default C++ search path.
Instead, add -stdlib as a cc1 option and teach the frontend how to find the
headers. The driver can then just pass -stdlib through to "cc1".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/InitHeaderSearch.cpp')
-rw-r--r-- | lib/Frontend/InitHeaderSearch.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp index f94edc65b9..238ff7fdc8 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp @@ -920,8 +920,12 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) { void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, const llvm::Triple &triple, const HeaderSearchOptions &HSOpts) { - if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes) - AddDefaultCPlusPlusIncludePaths(triple); + if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes) { + if (HSOpts.UseLibcxx) + AddPath("/usr/include/c++/v1", CXXSystem, true, false, false); + else + AddDefaultCPlusPlusIncludePaths(triple); + } AddDefaultCIncludePaths(triple, HSOpts); |