<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 5, 2017 at 6:29 AM Florian Hahn 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">fhahn added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:1050<br>
+      }<br>
+    assert(BranchI->getDebugLoc() && "Could not find debug location in header");<br>
+  }<br>
----------------<br>
fhahn wrote:<br>
> aprantl wrote:<br>
> > This assertion will fail if you haved a nodebug function inlined into a function with debuginfo.<br>
> Ah yes, I will look into how the inliner deals with that case and handle it appropriately.<br>
The basic block `header` is from a function with debug info (it comes from `oldFunction`). Isn't it save to assume that instructions in this basic block should have debug info?</blockquote><div><br>Even without nodebug functions, this assumption isn't necessarily safe. A debug-having function (an llvm::Function for which "getSubprogram" returns non-null) may have non-debug-having instructions (llvm::Instructions for which 'getDebugLoc' returns an empty debug location).<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Do you mean when inlining a nodebug function in one with debug info, some basic blocks could be missing debug info which could trigger this assertion in the partial inliner? (Sorry my knowledge of the assumptions  about debug info are quite light).<br>
<br>
<br>
<a href="https://reviews.llvm.org/D40413" rel="noreferrer" target="_blank">https://reviews.llvm.org/D40413</a><br>
<br>
<br>
<br>
</blockquote></div></div>