summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-07-20 21:44:43 +0000
committerChad Rosier <mcrosier@apple.com>2012-07-20 21:44:43 +0000
commit7a96c778248418286fad39858f5e947a574ba606 (patch)
tree47ec1a52df0a96b8f58905d2904b169c3c8b0fd8 /clang
parent00586de436e092b4a699ae5e1f0b3723814f0e8b (diff)
downloadbcm5719-llvm-7a96c778248418286fad39858f5e947a574ba606.tar.gz
bcm5719-llvm-7a96c778248418286fad39858f5e947a574ba606.zip
Add the mechanics for -fms-inline-asm. No easy way to test at this time.
llvm-svn: 160580
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Frontend/CodeGenOptions.h3
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp2
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
3 files changed, 6 insertions, 0 deletions
diff --git a/clang/include/clang/Frontend/CodeGenOptions.h b/clang/include/clang/Frontend/CodeGenOptions.h
index c8d6578b296..ecd86056e18 100644
--- a/clang/include/clang/Frontend/CodeGenOptions.h
+++ b/clang/include/clang/Frontend/CodeGenOptions.h
@@ -72,6 +72,8 @@ public:
unsigned EmitGcovArcs : 1; ///< Emit coverage data files, aka. GCDA.
unsigned EmitGcovNotes : 1; ///< Emit coverage "notes" files, aka GCNO.
unsigned EmitOpenCLArgMetadata : 1; /// Emit OpenCL kernel arg metadata.
+ unsigned EmitMicrosoftInlineAsm : 1; ///< Enable emission of MS-style inline
+ ///< assembly.
unsigned ForbidGuardVariables : 1; ///< Issue errors if C++ guard variables
///< are required
unsigned FunctionSections : 1; ///< Set when -ffunction-sections is enabled
@@ -201,6 +203,7 @@ public:
EmitGcovArcs = 0;
EmitGcovNotes = 0;
EmitOpenCLArgMetadata = 0;
+ EmitMicrosoftInlineAsm = 0;
ForbidGuardVariables = 0;
FunctionSections = 0;
HiddenWeakTemplateVTables = 0;
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index 1d71cddb6fc..26a31cdad4b 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -1684,4 +1684,6 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
void CodeGenFunction::EmitMSAsmStmt(const MSAsmStmt &S) {
// MS-style inline assembly is not fully supported, so sema emits a warning.
+ if (!CGM.getCodeGenOpts().EmitMicrosoftInlineAsm)
+ return;
}
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 544c0a270a0..4f3f6bdcc92 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1261,6 +1261,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data);
Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes);
Opts.EmitOpenCLArgMetadata = Args.hasArg(OPT_cl_kernel_arg_info);
+ Opts.EmitMicrosoftInlineAsm = Args.hasArg(OPT_fms_inline_asm);
Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file);
Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir);
Opts.LinkBitcodeFile = Args.getLastArgValue(OPT_mlink_bitcode_file);
OpenPOWER on IntegriCloud