summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChain.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-12-09 18:30:42 +0000
committerdim <dim@FreeBSD.org>2011-12-09 18:30:42 +0000
commitdc04cb328508e61aad809d9b53b12f9799a00e7d (patch)
tree81d5fcacdf8f076da7b2359bb7d62be6a453f0da /lib/Driver/ToolChain.cpp
parent3963a48221351c61c17fb3f382341ab04809a3d3 (diff)
downloadFreeBSD-src-dc04cb328508e61aad809d9b53b12f9799a00e7d.zip
FreeBSD-src-dc04cb328508e61aad809d9b53b12f9799a00e7d.tar.gz
Vendor import of clang 3.0 final release:
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_30/final@145349
Diffstat (limited to 'lib/Driver/ToolChain.cpp')
-rw-r--r--lib/Driver/ToolChain.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
index d09ab16..9453848 100644
--- a/lib/Driver/ToolChain.cpp
+++ b/lib/Driver/ToolChain.cpp
@@ -211,6 +211,11 @@ std::string ToolChain::ComputeEffectiveClangTriple(const ArgList &Args,
return ComputeLLVMTriple(Args, InputType);
}
+void ToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
+ ArgStringList &CC1Args) const {
+ // Each toolchain should provide the appropriate include flags.
+}
+
ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{
if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
StringRef Value = A->getValue(Args);
@@ -225,24 +230,18 @@ ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{
return ToolChain::CST_Libstdcxx;
}
-void ToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &Args,
- ArgStringList &CmdArgs,
- bool ObjCXXAutoRefCount) const {
- CXXStdlibType Type = GetCXXStdlibType(Args);
-
- // Header search paths are handled by the mass of goop in InitHeaderSearch.
-
- switch (Type) {
- case ToolChain::CST_Libcxx:
- if (ObjCXXAutoRefCount)
- CmdArgs.push_back("-fobjc-arc-cxxlib=libc++");
- break;
-
- case ToolChain::CST_Libstdcxx:
- if (ObjCXXAutoRefCount)
- CmdArgs.push_back("-fobjc-arc-cxxlib=libstdc++");
- break;
- }
+void ToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
+ ArgStringList &CC1Args) const {
+ // 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.
+ DriverArgs.AddAllArgs(CC1Args, options::OPT_stdlib_EQ);
}
void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
OpenPOWER on IntegriCloud