summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-07 10:12:59 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-07 10:12:59 +0000
commit21353f57301467c4c3f8cf1bf4789c89947dddab (patch)
tree582de3c7f2fb956cd73ab83d63729fcd7e834c39
parentb4ea64813e6b177b7b4e779228a6c60e88c03022 (diff)
Merging r143686:
------------------------------------------------------------------------ r143686 | chandlerc | 2011-11-04 00:34:47 -0700 (Fri, 04 Nov 2011) | 4 lines 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/branches/release_30@143927 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/ToolChain.h3
-rw-r--r--lib/Driver/ToolChain.cpp17
-rw-r--r--lib/Driver/Tools.cpp15
3 files changed, 13 insertions, 22 deletions
diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h
index ff8f7e4a67..4ac158ffce 100644
--- a/include/clang/Driver/ToolChain.h
+++ b/include/clang/Driver/ToolChain.h
@@ -209,8 +209,7 @@ public:
/// AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set
/// the include paths to use for the given C++ standard library type.
virtual void AddClangCXXStdlibIncludeArgs(const ArgList &Args,
- ArgStringList &CmdArgs,
- bool ObjCXXAutoRefCount) const;
+ ArgStringList &CmdArgs) const;
/// AddCXXStdlibLibArgs - Add the system specific linker arguments to use
/// for the given C++ standard library type.
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
index 88c39564ee..11deed1588 100644
--- a/lib/Driver/ToolChain.cpp
+++ b/lib/Driver/ToolChain.cpp
@@ -231,23 +231,8 @@ ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{
}
void ToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &Args,
- ArgStringList &CmdArgs,
- bool ObjCXXAutoRefCount) const {
- CXXStdlibType Type = GetCXXStdlibType(Args);
-
+ ArgStringList &CmdArgs) const {
// Header search paths are handled by each of the subclasses.
-
- 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::AddCXXStdlibLibArgs(const ArgList &Args,
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 5cdc820fc3..2513f225f5 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -425,10 +425,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);
}
}
@@ -1968,6 +1965,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,