<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;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 <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>
<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>
</body>
</html>