aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Driver/ToolChain.cpp11
-rw-r--r--lib/Driver/Tools.cpp5
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
index 11deed1588..5418436315 100644
--- a/lib/Driver/ToolChain.cpp
+++ b/lib/Driver/ToolChain.cpp
@@ -232,7 +232,16 @@ ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{
void ToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
- // Header search paths are handled by each of the subclasses.
+ // Header search paths should be handled by each of the subclasses.
+ // Historically, they have not been, and instead have been handled inside of
+ // the CC1-layer frontend. As the logic is hoisted out, this generic function
+ // will slowly stop being called.
+ //
+ // While it is being called, replicate a bit of a hack to propagate the
+ // '-stdlib=' flag down to CC1 so that it can in turn customize the C++
+ // header search paths with it. Once all systems are overriding this
+ // function, the CC1 flag and this line can be removed.
+ Args.AddAllArgs(CmdArgs, options::OPT_stdlib_EQ);
}
void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 47521c41a2..4f84d0a0dd 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -425,11 +425,8 @@ void Clang::AddPreprocessingOptions(const Driver &D,
getToolChain().AddClangSystemIncludeArgs(Args, CmdArgs);
// Add C++ include arguments, if needed.
- types::ID InputType = Inputs[0].getType();
- if (types::isCXX(InputType)) {
+ if (types::isCXX(Inputs[0].getType()))
getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
- Args.AddAllArgs(CmdArgs, options::OPT_stdlib_EQ);
- }
}
/// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targeting.