[PATCH] D42254: Add optional DICompileUnit to DIBuilder and make outlined debug info use that CU

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 11:50:22 PST 2018


Fair enough - thought maybe we had existing precedent for cloning+modifying
debug info, so thought it might be something we could reuse. But I can't
think of especially which optimization pass might be doing that... maybe
arg promotion? But I guess that doesn't create more functions, it probably
just creates one new function and destroys the old one.

On Thu, Jan 18, 2018 at 11:44 AM Adrian Prantl via Phabricator <
reviews at reviews.llvm.org> wrote:

> aprantl added inline comments.
>
>
> ================
> Comment at: lib/CodeGen/MachineOutliner.cpp:1288-1295
> +      DISubprogram *SP = DB->createFunction(
> +          Unit /* Context */, F->getName(),
> +          StringRef() /* Empty linkage name. */, Unit /* File */,
> +          0 /* Line numbers don't matter*/,
> +          DB->createSubroutineType(DB->getOrCreateTypeArray(None)), /*
> void */
> +          false, true, 0, /* Line in scope doesn't matter*/
> +          DINode::DIFlags::FlagArtificial /* Compiler-generated code. */,
> ----------------
> dblaikie wrote:
> > Any chance of cloning the DISubprogram from the original function, then
> modifying it? Or does it seem better to create a separate one like this? I
> guess this is fine (Adrian?)
> Since it will be a distinct MDNode modifying the clone is technically
> legal, but I don't consider it good practice. I think this approach is
> cleaner and easier to understand.
>
>
> https://reviews.llvm.org/D42254
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180118/10886f95/attachment.html>


More information about the llvm-commits mailing list