summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-04 07:34:47 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-04 07:34:47 +0000
commit491db32444e505c8a7985fe030e291cb796bc1d9 (patch)
treeecb8fea7181fa63fd521cad9a9e21f41a7552cc3 /clang/lib/Driver/Tools.cpp
parent9802c1406f06dc295df01ca86089a9e3de7224da (diff)
downloadbcm5719-llvm-491db32444e505c8a7985fe030e291cb796bc1d9.tar.gz
bcm5719-llvm-491db32444e505c8a7985fe030e291cb796bc1d9.zip
Sink the handling of -fobjc-arc-cxxlib to live with the other -fobjc-arc
implementation in the driver. This cleans up the signature and semantics of the include flag adding component of the toolchain. Another step to ready it for holding all the InitHeaderSearch logic. llvm-svn: 143686
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 24f88d9eb55..47521c41a21 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -427,10 +427,7 @@ void Clang::AddPreprocessingOptions(const Driver &D,
// Add C++ include arguments, if needed.
types::ID InputType = Inputs[0].getType();
if (types::isCXX(InputType)) {
- bool ObjCXXAutoRefCount
- = types::isObjC(InputType) && isObjCAutoRefCount(Args);
- getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs,
- ObjCXXAutoRefCount);
+ getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs);
Args.AddAllArgs(CmdArgs, options::OPT_stdlib_EQ);
}
}
@@ -1985,6 +1982,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (ARC) {
CmdArgs.push_back("-fobjc-arc");
+ // FIXME: It seems like this entire block, and several around it should be
+ // wrapped in isObjC, but for now we just use it here as this is where it
+ // was being used previously.
+ if (types::isCXX(InputType) && types::isObjC(InputType)) {
+ if (getToolChain().GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
+ CmdArgs.push_back("-fobjc-arc-cxxlib=libc++");
+ else
+ CmdArgs.push_back("-fobjc-arc-cxxlib=libstdc++");
+ }
+
// Allow the user to enable full exceptions code emission.
// We define off for Objective-CC, on for Objective-C++.
if (Args.hasFlag(options::OPT_fobjc_arc_exceptions,
OpenPOWER on IntegriCloud