[llvm-branch-commits] [cfe-branch] r143927 - in /cfe/branches/release_30: ./ include/clang/Driver/ToolChain.h lib/Driver/ToolChain.cpp lib/Driver/Tools.cpp

Chandler Carruth chandlerc at gmail.com
Mon Nov 7 02:13:00 PST 2011


Author: chandlerc
Date: Mon Nov  7 04:12:59 2011
New Revision: 143927

URL: http://llvm.org/viewvc/llvm-project?rev=143927&view=rev
Log:
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.
------------------------------------------------------------------------

Modified:
    cfe/branches/release_30/   (props changed)
    cfe/branches/release_30/include/clang/Driver/ToolChain.h
    cfe/branches/release_30/lib/Driver/ToolChain.cpp
    cfe/branches/release_30/lib/Driver/Tools.cpp

Propchange: cfe/branches/release_30/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov  7 04:12:59 2011
@@ -1,3 +1,3 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:142113,142133-142134,142187,142349,142474,142476,142918,143344-143345,143684
+/cfe/trunk:142113,142133-142134,142187,142349,142474,142476,142918,143344-143345,143684,143686
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_30/include/clang/Driver/ToolChain.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_30/include/clang/Driver/ToolChain.h?rev=143927&r1=143926&r2=143927&view=diff
==============================================================================
--- cfe/branches/release_30/include/clang/Driver/ToolChain.h (original)
+++ cfe/branches/release_30/include/clang/Driver/ToolChain.h Mon Nov  7 04:12:59 2011
@@ -209,8 +209,7 @@
   /// 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.

Modified: cfe/branches/release_30/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_30/lib/Driver/ToolChain.cpp?rev=143927&r1=143926&r2=143927&view=diff
==============================================================================
--- cfe/branches/release_30/lib/Driver/ToolChain.cpp (original)
+++ cfe/branches/release_30/lib/Driver/ToolChain.cpp Mon Nov  7 04:12:59 2011
@@ -231,23 +231,8 @@
 }
 
 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,

Modified: cfe/branches/release_30/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_30/lib/Driver/Tools.cpp?rev=143927&r1=143926&r2=143927&view=diff
==============================================================================
--- cfe/branches/release_30/lib/Driver/Tools.cpp (original)
+++ cfe/branches/release_30/lib/Driver/Tools.cpp Mon Nov  7 04:12:59 2011
@@ -425,10 +425,7 @@
   // 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 @@
   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,





More information about the llvm-branch-commits mailing list