[llvm-commits] [llvm] r163542 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/X86/intel-syntax-2.s
Bill Wendling
wendling at apple.com
Mon Sep 10 16:08:25 PDT 2012
On Sep 10, 2012, at 1:54 PM, Chad Rosier <mcrosier at apple.com> wrote:
> Author: mcrosier
> Date: Mon Sep 10 15:54:39 2012
> New Revision: 163542
>
> URL: http://llvm.org/viewvc/llvm-project?rev=163542&view=rev
> Log:
> [ms-inline asm] Add support for .att_syntax directive.
>
> Modified:
> llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
> llvm/trunk/test/MC/X86/intel-syntax-2.s
>
> Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=163542&r1=163541&r2=163542&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
> +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Sep 10 15:54:39 2012
> @@ -1745,7 +1745,10 @@
> return ParseDirectiveWord(2, DirectiveID.getLoc());
> else if (IDVal.startswith(".code"))
> return ParseDirectiveCode(IDVal, DirectiveID.getLoc());
> - else if (IDVal.startswith(".intel_syntax")) {
> + else if (IDVal.startswith(".att_syntax")) {
> + getParser().setAssemblerDialect(0);
> + return false;
> + } else if (IDVal.startswith(".intel_syntax")) {
> getParser().setAssemblerDialect(1);
Magic numbers...gross...would it be feasible to have an 'enum' here and then cast it to 'unsigned' when doing the assignment?
> if (getLexer().isNot(AsmToken::EndOfStatement)) {
> if(Parser.getTok().getString() == "noprefix") {
>
> Modified: llvm/trunk/test/MC/X86/intel-syntax-2.s
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/intel-syntax-2.s?rev=163542&r1=163541&r2=163542&view=diff
> ==============================================================================
> --- llvm/trunk/test/MC/X86/intel-syntax-2.s (original)
> +++ llvm/trunk/test/MC/X86/intel-syntax-2.s Mon Sep 10 15:54:39 2012
> @@ -1,7 +1,9 @@
> -// RUN: llvm-mc -triple x86_64-unknown-unknown %s | FileCheck %s
> +// RUN: llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=att %s | FileCheck %s
>
> .intel_syntax
> _test:
> // CHECK: movl $257, -4(%rsp)
> mov DWORD PTR [RSP - 4], 257
> -
> + .att_syntax
> +// CHECK: movl $257, -4(%rsp)
> + movl $257, -4(%rsp)
> \ No newline at end of file
*tsk tsk*
-bw
More information about the llvm-commits
mailing list