Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91370 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index f5c9c74..b4ea257 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -733,8 +733,9 @@
if (HSOpts.UseBuiltinIncludes) {
// Ignore the sys root, we *always* look for clang headers relative to
// supplied path.
- Init.AddPath(HSOpts.BuiltinIncludePath, System,
- false, false, false, /*IgnoreSysRoot=*/ true);
+ llvm::sys::Path P(HSOpts.ResourceDir);
+ P.appendComponent("include");
+ Init.AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true);
}
if (HSOpts.UseStandardIncludes)