[PATCH] D29240: IR: Consider two DISubprograms to be odr-equal if they have the same template parameters.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 18:36:45 PST 2017

On Mon, Jan 30, 2017 at 6:08 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

> I'm having trouble paging this back in.
> IIRC, one goal was to improve compile time by checking fewer fields.

I thought that was the point of the stuff in getHashValue() ?

That said, over the weekend I had some ideas about how to fix this debug
info odr business in a (IMHO) more principled way. If I get a chance I'll
send an RFC with a brain dump to llvm-dev.

Do you happen to know why the LinkageName wasn't sufficient here?  Sure,
> this fixes a crash, but why?

If we clone a module and try to disambiguate just based on LinkageName we
will consider the DISubprogram referring to the cloned DICompileUnit (via
TemplateParams) and the one referring to the original DICompileUnit to be
the same. That way we will end up with a cloned module containing a
non-distinct DISubprogram from the original module, itself referring to a
DICompileUnit not appearing in llvm.dbg.cu (i.e. the one from the original
module), which fails the verifier.

Also, for debug info testcases that aren't handmade, we usually include the
> C/C++ source in comments so that it's easy to regenerate them.  Maybe if I
> saw the source I would understand the root cause.

Okay, I'll also add the source. It's basically the test case from
https://bugs.chromium.org/p/chromium/issues/detail?id=682773#c14 with the
definitions removed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170130/e7c8e1c3/attachment.html>

More information about the llvm-commits mailing list