[cfe-commits] r104282 - /cfe/trunk/lib/Driver/ToolChains.cpp

Daniel Dunbar daniel at zuster.org
Thu May 20 14:48:38 PDT 2010


Author: ddunbar
Date: Thu May 20 16:48:38 2010
New Revision: 104282

URL: http://llvm.org/viewvc/llvm-project?rev=104282&view=rev
Log:
Driver: Switch to using the integrated assembler for standalone assembly jobs
(or -save-temps), when the integrated assembler is enabled.

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=104282&r1=104281&r2=104282&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Thu May 20 16:48:38 2010
@@ -11,6 +11,7 @@
 
 #include "clang/Driver/Arg.h"
 #include "clang/Driver/ArgList.h"
+#include "clang/Driver/Compilation.h"
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/HostInfo.h"
@@ -190,6 +191,16 @@
   else
     Key = JA.getKind();
 
+  // FIXME: This doesn't belong here, but ideally we will support static soon
+  // anyway.
+  bool HasStatic = (C.getArgs().hasArg(options::OPT_mkernel) ||
+                    C.getArgs().hasArg(options::OPT_static) ||
+                    C.getArgs().hasArg(options::OPT_fapple_kext));
+  bool IsIADefault = IsIntegratedAssemblerDefault() && !HasStatic;
+  bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as,
+                                             options::OPT_no_integrated_as,
+                                             IsIADefault);
+
   Tool *&T = Tools[Key];
   if (!T) {
     switch (Key) {
@@ -203,8 +214,13 @@
     case Action::PrecompileJobClass:
     case Action::CompileJobClass:
       T = new tools::darwin::Compile(*this); break;
-    case Action::AssembleJobClass:
-      T = new tools::darwin::Assemble(*this); break;
+    case Action::AssembleJobClass: {
+      if (UseIntegratedAs)
+        T = new tools::ClangAs(*this);
+      else
+        T = new tools::darwin::Assemble(*this);
+      break;
+    }
     case Action::LinkJobClass:
       T = new tools::darwin::Link(*this); break;
     case Action::LipoJobClass:





More information about the cfe-commits mailing list