<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1. How is clang going to discover the input operands, output operands,<br>
constraints, and clobbered registers?<br></blockquote><div><br></div><div>The approach you described sounds good to me. Reusing all the work done in the LLVM MC layer seems the right approach.</div><div><br></div><div> </div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In the above example, the two asm statments are not valid assembly.<br>
Thus, the AsmParser cannot parse these statements without some modifications.<br></blockquote><div><br></div><div>I'm not familiar how it works, but maybe a generic hook can be added in AsmParser, so when unknown identifiers are parsed, Clang can provide the needed information.
</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3. Which syntax, AT&T or Intel, should be passed to the backend?<br></blockquote><div><br></div><div>I'd prefer modifying the backend and passing the original syntax. Even if it involves some modifications, the advantages you listed are worth it.</div>

<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
4. How do we distinguish the assembly dialect at the IR level?<br></blockquote><div><br></div><div>I also agree about adding a new attribute to the IR. I'm not familiar with how IR metadata works, but instead of having specific syntax attributes (<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">iasyntaxatt</span>), it would be cleaner to have a generic asmsyntax attribute that could take att/intel values.</div>

<div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
5. How should the inline asm be represented in the AST?<br>
<br>
This is largely an open question and I'm still in the process of familiarize<br>
myself with the frontend.  Doing this in a sane way is going to be critical for<br>
providing good diagnostic information.<br></blockquote><div><br></div><div>At the moment it seems to be represented with a MSAsmStmt, which just provides a string representation of the assembly code. As we parse it, it would be good to have a proper AST for invidual assembly statements. Maybe we could represent them using a list of MCInst. Not sure how the MC layer works, but maybe we would have to fix the locations to match the original source code locations.</div>

<div> </div><div><br></div></div>-- <br>Joćo Matos<br>