[cfe-commits] [PATCH] MS style inline assembly support

Chris Lattner clattner at apple.com
Sat Jun 9 12:47:00 PDT 2012


On Jun 8, 2012, at 11:52 AM, Chad Rosier wrote:

> The attached patch etches out a new code path for MS style inline assembly in the Parser, Sema, AST, and CodeGen.  This is _largely_ a WIP!
> 
> The idea is to translate the MS style inline assembly into IR that is equivalent to the GNU style inline assembly.  That way the backend doesn't need to be modified (nor does our assembler implementation).  I was hoping to make further progress on this today, so please take a look if you have a quick second.

Cool, I'm glad to see this get started.  While this style of asm is annoying to implement, I really like it that users of the compiler don't have to worry about operand constraints (which they're extremely likely to get wrong and then blame the compiler when something changes).

Can you talk a bit about the envisioned design here?  How does the lexing of the asm work? How does name lookup of variables plug into the lexing?  Will this be completely x86 specific, or could we (in principle) extend it to support all targets that are interested?

I really like that the backend won't have to change for this.  Do you envision the assembler switching to ".intel_syntax" before emitting one of these, or do you envision the trick that gcc/llvm-gcc's uses, where it completely rewrites all syntax into AT&T style (including operands)?

-Chris






More information about the cfe-commits mailing list