summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r--clang/lib/Driver/ToolChains.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index ab866a2407e..c9e86334d50 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -2253,6 +2253,21 @@ static void addSystemIncludes(const ArgList &DriverArgs,
void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {
+ if (DriverArgs.hasArg(options::OPT_nostdinc))
+ return;
+
+ if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
+ // Ignore the sysroot, we *always* look for clang headers relative to
+ // supplied path.
+ llvm::sys::Path P(getDriver().ResourceDir);
+ P.appendComponent("include");
+ CC1Args.push_back("-internal-nosysroot-isystem");
+ CC1Args.push_back(DriverArgs.MakeArgString(P.str()));
+ }
+
+ if (DriverArgs.hasArg(options::OPT_nostdlibinc))
+ return;
+
std::string VSDir;
std::string WindowsSDKDir;
OpenPOWER on IntegriCloud