summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-07-20 21:20:33 +0000
committerChad Rosier <mcrosier@apple.com>2012-07-20 21:20:33 +0000
commited94324e70729c651ae13801e0e04c601988c530 (patch)
treef9a6d38a99ab15407f96fbd78882a7903111b54d /clang
parent1f41bf0c3f44ac457b9c1da7fc0d18b7d35e8a6f (diff)
downloadbcm5719-llvm-ed94324e70729c651ae13801e0e04c601988c530.tar.gz
bcm5719-llvm-ed94324e70729c651ae13801e0e04c601988c530.zip
Add a new flag, -fms-inline-asm, that enables the output of MS-style inline
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. llvm-svn: 160573
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Driver/CC1Options.td2
-rw-r--r--clang/include/clang/Driver/Options.td2
-rw-r--r--clang/lib/Driver/Tools.cpp4
-rw-r--r--clang/test/Driver/clang_f_opts.c3
4 files changed, 11 insertions, 0 deletions
diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td
index 8fd3166ebe4..97884de2aab 100644
--- a/clang/include/clang/Driver/CC1Options.td
+++ b/clang/include/clang/Driver/CC1Options.td
@@ -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">,
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 0c4760bbb9d..a655826ba04 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -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]>,
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index e07068aea14..5c00a7f591e 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -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,
diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c
index b74b2855014..621026eeebe 100644
--- a/clang/test/Driver/clang_f_opts.c
+++ b/clang/test/Driver/clang_f_opts.c
@@ -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
OpenPOWER on IntegriCloud