[PATCH] D40413: [CodeExtractor] Add debug locations for new call and branch instrs.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 10:28:54 PST 2017


On Tue, Dec 5, 2017 at 6:29 AM Florian Hahn via Phabricator <
reviews at reviews.llvm.org> wrote:

> fhahn added inline comments.
>
>
> ================
> Comment at: lib/Transforms/Utils/CodeExtractor.cpp:1050
> +      }
> +    assert(BranchI->getDebugLoc() && "Could not find debug location in
> header");
> +  }
> ----------------
> fhahn wrote:
> > aprantl wrote:
> > > This assertion will fail if you haved a nodebug function inlined into
> a function with debuginfo.
> > Ah yes, I will look into how the inliner deals with that case and handle
> it appropriately.
> 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?


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).


> 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).
>
>
> https://reviews.llvm.org/D40413
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171205/072a4ef1/attachment.html>


More information about the llvm-commits mailing list