[cfe-commits] r160573 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Driver/Options.td lib/Driver/Tools.cpp test/Driver/clang_f_opts.c

Chad Rosier mcrosier at apple.com
Fri Jul 20 16:16:32 PDT 2012


On Jul 20, 2012, at 3:59 PM, Eli Friedman wrote:

> On Fri, Jul 20, 2012 at 2:20 PM, Chad Rosier <mcrosier at apple.com> wrote:
>> Author: mcrosier
>> Date: Fri Jul 20 16:20:33 2012
>> New Revision: 160573
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=160573&view=rev
>> Log:
>> 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.
> 
> Mind naming the flag something which doesn't encourage people to use
> it while it's still experimental?
> "-fenable-experimental-ms-inline-asm" or something like that.

I with with "-fsuch-a-bad-idea-to-enable-ms-inline-asm" in r160590.

 Chad

> -Eli
> 
>> Modified:
>>    cfe/trunk/include/clang/Driver/CC1Options.td
>>    cfe/trunk/include/clang/Driver/Options.td
>>    cfe/trunk/lib/Driver/Tools.cpp
>>    cfe/trunk/test/Driver/clang_f_opts.c
>> 
>> Modified: cfe/trunk/include/clang/Driver/CC1Options.td
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=160573&r1=160572&r2=160573&view=diff
>> ==============================================================================
>> --- cfe/trunk/include/clang/Driver/CC1Options.td (original)
>> +++ cfe/trunk/include/clang/Driver/CC1Options.td Fri Jul 20 16:20:33 2012
>> @@ -338,6 +338,8 @@
>>   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">,
>> 
>> Modified: cfe/trunk/include/clang/Driver/Options.td
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=160573&r1=160572&r2=160573&view=diff
>> ==============================================================================
>> --- cfe/trunk/include/clang/Driver/Options.td (original)
>> +++ cfe/trunk/include/clang/Driver/Options.td Fri Jul 20 16:20:33 2012
>> @@ -454,6 +454,8 @@
>> 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]>,
>> 
>> Modified: cfe/trunk/lib/Driver/Tools.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=160573&r1=160572&r2=160573&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/Tools.cpp (original)
>> +++ cfe/trunk/lib/Driver/Tools.cpp Fri Jul 20 16:20:33 2012
>> @@ -2456,6 +2456,10 @@
>>                    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,
>> 
>> Modified: cfe/trunk/test/Driver/clang_f_opts.c
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang_f_opts.c?rev=160573&r1=160572&r2=160573&view=diff
>> ==============================================================================
>> --- cfe/trunk/test/Driver/clang_f_opts.c (original)
>> +++ cfe/trunk/test/Driver/clang_f_opts.c Fri Jul 20 16:20:33 2012
>> @@ -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
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list