<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 28, 2019 at 11:12 AM <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3049507084729376003WordSection1">
<p class="MsoNormal">Hey Paul,<br>
<br>
I've been experimenting with DWARFv5 broadly applied to some code at Google & found that clang crashes when trying to emit DWARFv5 on an empty assembly file. Turns out llvm-mc does not because of the above code block.<br>
<br>
Seems this support is here for llvm-mc, but missing from clang's initialization of MCContext for cc1as. <br>
<br>
Could you refactor/common/add equivalent functionality to Clang's cc1as? (looks like somewhere near clang/tools/driver/cc1as_main.cpp:400? (since that is where "setMainFileName" is, which is near this block in llvm-mc too))<br>
<br>
- Dave<br>
<br>
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
</div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3049507084729376003WordSection1"><p class="MsoNormal"><a name="m_-3049507084729376003__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">You mean, like a zero-length file?  For me, `llvm-mc –g t.s` also crashes with that.  Or a .s file with only a comment in it.</span></a></p></div></div></blockquote><div><br>Hmm, llvm-mc doesn't seem to crash for me... <br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3049507084729376003WordSection1"><p class="MsoNormal"><a name="m_-3049507084729376003__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Looks like clang and llvm-mc crash in different places too.</span></p></div></div></blockquote><div><br></div><div>Maybe different default targets, etc? Not sure.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3049507084729376003WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> </span><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">I'll take a look.</span></p></div></div></blockquote><div><br>Thanks!<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3049507084729376003WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
</div>
</div>

</blockquote></div></div>