<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Me too.<div><br></div><div>-j<br><div><div>On Jan 14, 2013, at 10:53 AM, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">LGTM<div><br></div><div> - Daniel</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 14, 2013 at 9:43 AM, Eli Bendersky <span dir="ltr"><<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The aim of this patch is to fix the following piece of code in the<br>
platform-independent AsmParser:<br>
<br>
void AsmParser::CheckForValidSection() {<br>
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {<br>
    TokError("expected section directive before assembly directive");<br>
    Out.SwitchSection(Ctx.getMachOSection(<br>
                        "__TEXT", "__text",<br>
                        MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,<br>
                        0, SectionKind::getText()));<br>
  }<br>
}<br>
<br>
This was added for the "-n" option of llvm-mc.<br>
<br>
The proposed fix adds another virtual method to MCStreamer, called<br>
InitToTextSection. Conceptually, it's similar to the existing<br>
InitSections which initializes all common sections and switches to<br>
text. The new method is implemented by each platform streamer in a way<br>
that it sees fit. So AsmParser can now do this:<br>
<br>
void AsmParser::CheckForValidSection() {<br>
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {<br>
    TokError("expected section directive before assembly directive");<br>
    Out.InitToTextSection();<br>
  }<br>
}<br>
<br>
Which is much more reasonable.<br>
<br>
Please take a look.<br>
<br>
P.S.: some streamers like the Asm streamer and Pure streamer still do<br>
the MachO-specific thing. This should also be fixed, but probably in a<br>
separate patch.<br>
<span class="HOEnZb"><font color="#888888"><br>
Eli<br>
</font></span><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></body></html>