]> granicus.if.org Git - clang/commitdiff
Add a new flag, -fms-inline-asm, that enables the output of MS-style inline
authorChad Rosier <mcrosier@apple.com>
Fri, 20 Jul 2012 21:20:33 +0000 (21:20 +0000)
committerChad Rosier <mcrosier@apple.com>
Fri, 20 Jul 2012 21:20:33 +0000 (21:20 +0000)
assembly.

By default, we don't emit IR for MS-style inline assembly (see r158833 as to
why).  This is strictly for testing purposes and should not be enabled with the
expectation that things will work.  This is a temporary flag and will be removed
once MS-style inline assembly is fully supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160573 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Driver/Tools.cpp
test/Driver/clang_f_opts.c

index 8fd3166ebe4b69aa3b80a435fd9a24d8e66655ef..97884de2aab436d0c962335e3ec7e4177f86a6bb 100644 (file)
@@ -338,6 +338,8 @@ def rewrite_macros : Flag<"-rewrite-macros">,
   HelpText<"Expand macros without full preprocessing">;
 def migrate : Flag<"-migrate">,
   HelpText<"Migrate source code">;
+def emit_ms_asm : Flag<"-enable-ms-asm">,
+  HelpText<"Enable MS-style inline assembly">;
 }
 
 def mt_migrate_directory : Separate<"-mt-migrate-directory">,
index 0c4760bbb9de98e447299d8baa9d05eea28fa996..a655826ba044ab4ca84666680b95535022def87f 100644 (file)
@@ -454,6 +454,8 @@ def fmerge_all_constants : Flag<"-fmerge-all-constants">, Group<f_Group>;
 def fmessage_length_EQ : Joined<"-fmessage-length=">, Group<f_Group>;
 def fms_extensions : Flag<"-fms-extensions">, Group<f_Group>, Flags<[CC1Option]>,
   HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">;
+def fms_inline_asm : Flag<"-fms-inline-asm">, Group<f_Group>, Flags<[CC1Option]>,
+  HelpText<"Enable support for Microsoft style inine assembly">;
 def fms_compatibility : Flag<"-fms-compatibility">, Group<f_Group>, Flags<[CC1Option]>,
   HelpText<"Enable Microsoft compatibility mode">;
 def fmsc_version : Joined<"-fmsc-version=">, Group<f_Group>, Flags<[CC1Option]>,
index e07068aea1400f315becf0ac3d73b2375beb6c8c..5c00a7f591eaaba917085043e31f3f2ae59db9fe 100644 (file)
@@ -2456,6 +2456,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                    getToolChain().getTriple().getOS() == llvm::Triple::Win32))
     CmdArgs.push_back("-fms-extensions");
 
+  // -fms-inline-asm.
+  if (Args.hasArg(options::OPT_fms_inline_asm))
+    CmdArgs.push_back("-fms-inline-asm");
+
   // -fms-compatibility=0 is default.
   if (Args.hasFlag(options::OPT_fms_compatibility, 
                    options::OPT_fno_ms_compatibility,
index b74b285501464954f625416d8a271ba1a557a718..621026eeebeafc6c914cda98d8f30d8c7a0f7ddd 100644 (file)
@@ -35,3 +35,6 @@
 // RUN: %clang -### -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s
 // FP-CONTRACT-FAST-CHECK: -ffp-contract=fast
 // FP-CONTRACT-OFF-CHECK: -ffp-contract=off
+
+// RUN: %clang -fms-extensions -fms-inline-asm %s -### 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS3 %s
+// CHECK-OPTIONS3: -fms-inline-asm