<div dir="ltr">Should this be limited only to the `.space` case or `.fill` as well? The `.fill` implementation currently emits multiple directives in the constant case, we could instead just emit `.fill` directive so it's the same both in absolute and symbol case,<span class="inbox-inbox-Apple-converted-space"> but that</span> means we'd have to change the current behavior, is that fine with you?</div><br><div class="gmail_quote"><div dir="ltr">On Tue, May 24, 2016 at 11:52 AM Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 24 May 2016 at 14:29, Petr Hosek <<a href="mailto:phosek@chromium.org" target="_blank">phosek@chromium.org</a>> wrote:<br>
> phosek added inline comments.<br>
><br>
> ================<br>
> Comment at: lib/MC/MCAsmStreamer.cpp:823<br>
> @@ +822,3 @@<br>
> +  int64_t IntNumBytes;<br>
> +  if (NumBytes->evaluateAsAbsolute(IntNumBytes)) {<br>
> +    EmitFill(IntNumBytes, Value);<br>
> ----------------<br>
> rafael wrote:<br>
>> You don't need to this in the asm streamer. My suggestion would be to just make this a variant of emitFill. We would have one overload that takes a number and one that takes an expression. The implementations would be:<br>
>><br>
>> * In the asm streamer: the ones taking an MCExpr does the printing. The other one creates an MCExpr and forwards.<br>
>> * In the obj streamer: what you have now. Try to evaluate the expr and maybe fail. If it works, forward to the overload that takes a number.<br>
> In case of `MCAsmStreamer`, where would we evaluate the `MCExpr` expression then? Does it mean we should always print out the expression even if it's absolute?<br>
<br>
Even is's *not* absolute? Correct. In the patch we already have<br>
different views of what is absolute:<br>
<br>
if (!NumBytes->evaluateAsAbsolute(IntNumBytes, getAssembler()))<br>
<br>
versus<br>
<br>
if (NumBytes->evaluateAsAbsolute(IntNumBytes))<br>
<br>
passing an assemble enables more expressions to be evaluated as constants.<br>
<br>
I think the reasonable options are<br>
<br>
* Bath asm and obj streamers have exactly the same idea of what is absolute.<br>
* The asm streamer doesn't even try to find out if something is absolute.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div>