aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-14 02:03:00 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-14 02:03:00 +0000
commiteb840bd0e473ee11622e084a0d6ff276ee7aa5c6 (patch)
tree263381889e8e9e0bffdc401e3f2770ffbfbee21c
parent7d94918334ff041b34240e5b031c7c15d838201a (diff)
Driver: Enable -integrated-as by default, at least for Darwin/x86 without -static.
- How else will we figure out what is broken, eh? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103759 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/Driver.cpp11
-rw-r--r--lib/Driver/ToolChains.h7
2 files changed, 15 insertions, 3 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 0c1a5a3309..916cdba3ec 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -902,9 +902,16 @@ static const Tool &SelectToolForJob(Compilation &C, const ToolChain *TC,
// 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())) {
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index c15656f488..ad975bfe6d 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -56,7 +56,7 @@ class LLVM_LIBRARY_VISIBILITY Darwin : public ToolChain {
/// Whether we are targetting iPhoneOS target.
mutable bool TargetIsIPhoneOS;
-
+
/// The OS version we are targetting.
mutable unsigned TargetVersion[3];
@@ -159,6 +159,11 @@ public:
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;