fix a bug introduced in my previous patch: moving clang headers to the
"after" group instead of the system group makes it so #include <limits.h>
picks up the *system* limits.h file before clang's. This causes a failure
on linux and is definitely not what we want.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65026 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/InitHeaderSearch.cpp b/lib/Driver/InitHeaderSearch.cpp
index 4b5275d..5b0b2c2 100644
--- a/lib/Driver/InitHeaderSearch.cpp
+++ b/lib/Driver/InitHeaderSearch.cpp
@@ -24,7 +24,7 @@
void InitHeaderSearch::AddPath(const std::string &Path, IncludeDirGroup Group,
bool isCXXAware, bool isUserSupplied,
- bool isFramework) {
+ bool isFramework, bool IgnoreSysRoot) {
assert(!Path.empty() && "can't handle empty path here");
FileManager &FM = Headers.getFileMgr();
@@ -32,7 +32,7 @@
llvm::SmallString<256> MappedPath;
// Handle isysroot.
- if (Group == System) {
+ if (Group == System && !IgnoreSysRoot) {
// FIXME: Portability. This should be a sys::Path interface, this doesn't
// handle things like C:\ right, nor win32 \\network\device\blah.
if (isysroot.size() != 1 || isysroot[0] != '/') // Add isysroot if present.