[cfe-commits] r135604 - in /cfe/trunk: lib/Driver/ToolChains.cpp test/Driver/ccc-host-triple-no-integrated-as.c
Chad Rosier
mcrosier at apple.com
Wed Jul 20 12:14:30 PDT 2011
Author: mcrosier
Date: Wed Jul 20 14:14:30 2011
New Revision: 135604
URL: http://llvm.org/viewvc/llvm-project?rev=135604&view=rev
Log:
If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple
x86_64-pc-win32-macho is used in conjunction with -no-integrated-as go ahead and
use the Darwin system assembler.
rdar://9785470
Added:
cfe/trunk/test/Driver/ccc-host-triple-no-integrated-as.c
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=135604&r1=135603&r2=135604&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Jul 20 14:14:30 2011
@@ -1752,6 +1752,10 @@
else
Key = JA.getKind();
+ bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as,
+ options::OPT_no_integrated_as,
+ IsIntegratedAssemblerDefault());
+
Tool *&T = Tools[Key];
if (!T) {
switch (Key) {
@@ -1766,7 +1770,11 @@
case Action::CompileJobClass:
T = new tools::Clang(*this); break;
case Action::AssembleJobClass:
- T = new tools::ClangAs(*this); break;
+ if (!UseIntegratedAs && getTriple().getEnvironment() == llvm::Triple::MachO)
+ T = new tools::darwin::Assemble(*this);
+ else
+ T = new tools::ClangAs(*this);
+ break;
case Action::LinkJobClass:
T = new tools::visualstudio::Link(*this); break;
}
Added: cfe/trunk/test/Driver/ccc-host-triple-no-integrated-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ccc-host-triple-no-integrated-as.c?rev=135604&view=auto
==============================================================================
--- cfe/trunk/test/Driver/ccc-host-triple-no-integrated-as.c (added)
+++ cfe/trunk/test/Driver/ccc-host-triple-no-integrated-as.c Wed Jul 20 14:14:30 2011
@@ -0,0 +1,20 @@
+// Check that -no-integrated-as works when -ccc-host-triple i386-pc-win32-macho or
+// -ccc-host-triple x86_64-pc-win32-macho is specified.
+
+// RUN: %clang -### -c -ccc-host-triple i386-pc-win32-macho -no-integrated-as %s 2> %t1
+// RUN: FileCheck -check-prefix=X86 < %t1 %s
+// RUN: %clang -### -c -ccc-host-triple x86_64-pc-win32-macho -no-integrated-as %s 2> %t2
+// RUN: FileCheck -check-prefix=X86_64 < %t2 %s
+//
+// X86: "-cc1"
+// X86-NOT: "-cc1as"
+// X86: "-arch"
+// X86: "i386"
+//
+// X86_64: "-cc1"
+// X86_64-NOT: "-cc1as"
+// X86_64: "-arch"
+// X86_64: "x86_64"
+
+
+
More information about the cfe-commits
mailing list