[cfe-commits] r133490 - in /cfe/trunk: lib/Driver/ToolChains.cpp test/Driver/darwin-xarch.c
Daniel Dunbar
daniel at zuster.org
Mon Jun 20 17:20:17 PDT 2011
Author: ddunbar
Date: Mon Jun 20 19:20:17 2011
New Revision: 133490
URL: http://llvm.org/viewvc/llvm-project?rev=133490&view=rev
Log:
Driver/Darwin: Honor -Xarch_FOO when the arch matches either the toolchain or
the architecture being bound.
- Fixes things like -Xarch_armv7.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/Driver/darwin-xarch.c
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=133490&r1=133489&r2=133490&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Mon Jun 20 19:20:17 2011
@@ -682,8 +682,13 @@
Arg *A = *it;
if (A->getOption().matches(options::OPT_Xarch__)) {
+ // Skip this argument unless the architecture matches either the toolchain
+ // triple arch, or the arch being bound.
+ //
// FIXME: Canonicalize name.
- if (getArchName() != A->getValue(Args, 0))
+ llvm::StringRef XarchArch = A->getValue(Args, 0);
+ if (!(XarchArch == getArchName() ||
+ (BoundArch && XarchArch == BoundArch)))
continue;
Arg *OriginalArg = A;
Modified: cfe/trunk/test/Driver/darwin-xarch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-xarch.c?rev=133490&r1=133489&r2=133490&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-xarch.c (original)
+++ cfe/trunk/test/Driver/darwin-xarch.c Mon Jun 20 19:20:17 2011
@@ -12,3 +12,9 @@
// RUN: FileCheck --check-prefix=CHECK-LINK < %t %s
//
// CHECK-LINK: ld{{.*}} "-arch" "i386"{{.*}} "-some-linker-arg"
+
+// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
+// RUN: -arch armv7 -Xarch_armv7 -Wl,-some-linker-arg -filelist X 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ARMV7-LINK < %t %s
+//
+// CHECK-ARMV7-LINK: ld{{.*}} "-arch" "armv7"{{.*}} "-some-linker-arg"
More information about the cfe-commits
mailing list