[llvm] r204107 - DwarfDebug: Only unique retained types instead of all types.

Adrian Prantl aprantl at apple.com
Thu Mar 27 09:51:49 PDT 2014

On Mar 27, 2014, at 9:43 AM, David Blaikie <dblaikie at gmail.com> wrote:

> On Thu, Mar 27, 2014 at 9:39 AM, Adrian Prantl <aprantl at apple.com> wrote:
>> On Mar 26, 2014, at 11:15 PM, WenHan Gu (谷汶翰) <wenhan.gu at gmail.com> wrote:
>>> Hi Adrian,
>>> After this commit, there's sometimes assert fail on large bitcodes on my environment.
>> Is there any chance you can provide me with a reduced example that reproduces this?
>>> According to my result, two types seems the same, and I take out the assert fail can still build and run.
>>> Is any possible that the contained MDNode is not the same (since it is a pointer comparison indeed) but this is reasonable?
>>> Thanks!
>> Since the MDNodes are kept in a FoldingSet there should be no two identical nodes. What may happen in your case is that the source code contains two conflicting definitions of the same type in two compilation units. This is illegal C++ (violation of the ODR), but the compiler currently has no way to diagnose such a situation.
>> On a related note, this made me realize that this assertion should only be enabled for C++ compilation units; I will fix this soon. This will not fix your problem, unfortunately.
> Hmm? The assertion should still be true in any case, shouldn't it?
> (the 'reference' will just be a straight MDNode when we don't have a
> mangled name there) But perhaps I'm forgetting the exact schema.
You’re right, while there may be conflicting definitions for a type in a non-ODR-language, resolve() would also be a noop (no such thing as an ID field in a C DIType), so this would still be safe.

-- adrian

More information about the llvm-commits mailing list