[cfe-commits] r103759 - in /cfe/trunk/lib/Driver: Driver.cpp ToolChains.h

Daniel Dunbar daniel at zuster.org
Thu May 13 19:03:00 PDT 2010


Author: ddunbar
Date: Thu May 13 21:03:00 2010
New Revision: 103759

URL: http://llvm.org/viewvc/llvm-project?rev=103759&view=rev
Log:
Driver: Enable -integrated-as by default, at least for Darwin/x86 without -static.
 - How else will we figure out what is broken, eh?

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

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=103759&r1=103758&r2=103759&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu May 13 21:03:00 2010
@@ -902,9 +902,16 @@
   // See if we should look for a compiler with an integrated assembler. We match
   // bottom up, so what we are actually looking for is an assembler job with a
   // compiler input.
-  if (C.getArgs().hasArg(options::OPT_integrated_as,
+
+  // 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 = (TC->IsIntegratedAssemblerDefault() && !HasStatic);
+  if (C.getArgs().hasFlag(options::OPT_integrated_as,
                          options::OPT_no_integrated_as,
-                         TC->IsIntegratedAssemblerDefault()) &&
+                         IsIADefault) &&
       !C.getArgs().hasArg(options::OPT_save_temps) &&
       isa<AssembleJobAction>(JA) &&
       Inputs->size() == 1 && isa<CompileJobAction>(*Inputs->begin())) {

Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=103759&r1=103758&r2=103759&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Thu May 13 21:03:00 2010
@@ -56,7 +56,7 @@
 
   /// Whether we are targetting iPhoneOS target.
   mutable bool TargetIsIPhoneOS;
-  
+
   /// The OS version we are targetting.
   mutable unsigned TargetVersion[3];
 
@@ -159,6 +159,11 @@
     else
       return !isMacosxVersionLT(10, 6);
   }
+  virtual bool IsIntegratedAssemblerDefault() const {
+    // Default integrated assembler to on for x86.
+    return (getTriple().getArch() == llvm::Triple::x86 ||
+            getTriple().getArch() == llvm::Triple::x86_64);
+  }
   virtual bool IsObjCNonFragileABIDefault() const {
     // Non-fragile ABI is default for everything but i386.
     return getTriple().getArch() != llvm::Triple::x86;





More information about the cfe-commits mailing list