<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 2, 2016 at 1:38 PM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aprantl added a comment.<br class="gmail_msg">
<br class="gmail_msg">
In <a href="https://reviews.llvm.org/D26256#586228" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D26256#586228</a>, @rob.lougher wrote:<br class="gmail_msg">
<br class="gmail_msg">
> In <a href="https://reviews.llvm.org/D26256#586214" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D26256#586214</a>, @aprantl wrote:<br class="gmail_msg">
><br class="gmail_msg">
> > Shouldn't it only drop the location if the two locations are distinct (and perhaps add a discriminator)?<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
> Sorry, didn't make myself clear in the last comment. As the two instructions feed into a phi node they are in different basic-blocks, so the two locations must be distinct (they are in different scopes and will have different discriminators). But in the case where we have an if-then-else all on the same line we could create a new debug location with a different scope/discriminator.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Yes, that sounds reasonable.<br class="gmail_msg">
<br class="gmail_msg">
I think the single-line situation is not just an edge case and we should handle it correctly. In C++11 it is becoming quite common to have a lot of control flow on a single line (think anything from <algorithm> with lambdas or the ternary operator).<br class="gmail_msg"></blockquote><div><br></div><div>I'm not sure how practical it is to find the right scope to tie this in to... (at least not obvious to me off the cuff) nor how much it'd help the debugging experience to have this info. But I'm not too invested either way.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D26256" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D26256</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div></div>