<html><head><base href="x-msg://1221/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Vladimir,<div><br></div><div>This sounds reasonable to me. Allowing a target to hook into otherwise generic directives seems a good thing. Copious testing to make sure there's nothing subtle going on would be a good idea, of course. :)</div><div><br></div><div>-Jim</div><div><br><div><div>On May 9, 2012, at 6:26 AM, Medic, Vladimir wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div ocsi="0" fpstyle="1"><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; ">I'm trying to build a standalone assembler for Mips using AsmParser and I'm facing a problem with assembly directives. Mips assembler has following syntax for .set directive<br><br>  .set reorder  <span class="Apple-converted-space"> </span><br><br>or<br><br>  .set noreorder<br><br>which allow/disallow assembler to change the order of instructions in the block that follows. As the implemented AsmParser requires .set directive to have the following syntax:<br><br>/// ParseDirectiveSet:<br>///   ::= .set identifier ',' expression<br><br>I am getting an error reported when '.set reoeder/noreorder' is met in the code. After some investigation it seems reasonable for me to move the code which handles target specific directive parsing from the end to the beginning of the block, like this (AsmParser::ParseStatement, AsmParser.cpp line 1225):<br><br>  // Otherwise, we have a normal instruction or directive.<br>  if (IDVal[0] == '.' && IDVal != ".") {<br>   <span class="Apple-converted-space"> </span><br>    // Target hook for parsing target specific directives.<br>    if (!getTargetParser().ParseDirective(ID))<br>      return false;<br>  .<br>  .<br>  .<br>  .<br>}<br> thus allowing the target specific directives to be handled first rather then at the end.<br><br>What is your opinion regarding this change?<br><br>Kind regards<br><br>Vladimir<br><br></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></span></blockquote></div><br></div></body></html>