[PATCH] D42157: [clang-cl] Let /FA output use intel assembly.

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 18:14:39 PST 2018


thakis created this revision.
thakis added a reviewer: hans.

cl.exe's assembly output is in intel syntax, so clang-cl's should be too, PR35031.


https://reviews.llvm.org/D42157

Files:
  lib/Driver/ToolChains/Clang.cpp
  test/Driver/masm.c


Index: test/Driver/masm.c
===================================================================
--- test/Driver/masm.c
+++ test/Driver/masm.c
@@ -2,11 +2,13 @@
 // RUN: %clang -target i386-unknown-linux -masm=att -S %s -### 2>&1 | FileCheck --check-prefix=CHECK-ATT %s
 // RUN: %clang -target i386-unknown-linux -S -masm=somerequired %s -### 2>&1 | FileCheck --check-prefix=CHECK-SOMEREQUIRED %s
 // RUN: %clang -target arm-unknown-eabi -S -masm=intel %s -### 2>&1 | FileCheck --check-prefix=CHECK-ARM %s
+// RUN: %clang_cl /Fa -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CL %s
 
 int f() {
 // CHECK-INTEL: -x86-asm-syntax=intel
 // CHECK-ATT: -x86-asm-syntax=att
 // CHECK-SOMEREQUIRED: error: unsupported argument 'somerequired' to option 'masm='
 // CHECK-ARM: warning: argument unused during compilation: '-masm=intel'
+// CHECK-CL: -x86-asm-syntax=intel
   return 0;
 }
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -1761,6 +1761,9 @@
       getToolChain().getDriver().Diag(diag::err_drv_unsupported_option_argument)
           << A->getOption().getName() << Value;
     }
+  } else if (getToolChain().getDriver().IsCLMode()) {
+    CmdArgs.push_back("-mllvm");
+    CmdArgs.push_back("-x86-asm-syntax=intel");
   }
 
   // Set flags to support MCU ABI.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42157.130082.patch
Type: text/x-patch
Size: 1399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180117/6a9b9807/attachment.bin>


More information about the cfe-commits mailing list