<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 6, 2016 at 11:29 AM Paul Robinson via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">probinson added inline comments.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: lib/Transforms/Utils/InlineFunction.cpp:1377-1378<br class="gmail_msg">
       if (!DL) {<br class="gmail_msg">
+        if (CalleeHasDebugInfo)<br class="gmail_msg">
+          continue;<br class="gmail_msg">
         // If the inlined instruction has no line number, make it look as if it<br class="gmail_msg">
----------------<br class="gmail_msg">
dblaikie wrote:<br class="gmail_msg">
> Leaving this instruction without a location at all may be problematic - it's still certainly inlined from this other function... - what can we do about that, if anything? (only thing that comes to mind is giving it a zero debug location, but that doesn't sound right)<br class="gmail_msg">
><br class="gmail_msg">
> Maybe no debug location is the right solution... - I wonder how that interacts with the inline range for the instruction, etc.<br class="gmail_msg">
If it had no location in the called function, seems like it's not inherently different for it to have no location when moved into the calling function.  An instruction with no location implicitly inherits the preceding location, no? That's no different in the caller than the callee.<br class="gmail_msg"></blockquote><div><br></div><div>Well, ish. The specifically interesting part would be if the inlined code gets spread around, or any instructions at the start of the inlined code.<br><br>say we have a function with instructions:<br><br>A<br>B(loc1)<br><br>inlined into function with instructions:<br><br>C(loc2)<br>D(call, loc3)<br><br>so we end up with:<br><br>C(loc2)<br>A<br>B(loc1->loc3)<br><br>So now the range of the inlined function is {B}, whereas it really should be {A, B}, even if A gets no specific location (essentially the ideal would be A gets an inherited location from the prior instruction, except if that crosses the inlined function boundary)<br><br>But that's probably impractical to implement in LLVM quickly/easily, so this is probably a reasonable fix for now.<br><br>Adrian - thoughts?</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/D27462" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D27462</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div></div>