diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-11-04 07:34:47 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-11-04 07:34:47 +0000 |
commit | 7ffa0325bd61f656697f99434334d425c39af309 (patch) | |
tree | a02934f492ab21534dd6375ab845bc4b757aa7b6 /lib/Driver/Tools.cpp | |
parent | b5870e77a9a872e2a84e904a332bb60bbe207da9 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 24f88d9eb5..47521c41a2 100644 --- a/lib/Driver/Tools.cpp +++ b/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, |