[PATCH] D26212: IRMover: Avoid accidentally mapping types from the destination module (PR30799)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 15:14:32 PDT 2016


hans added a comment.

In https://reviews.llvm.org/D26212#585258, @mehdi_amini wrote:

> > During Module linking, it's possible for SrcM->getIdentifiedStructTypes(); to return types that are actually defined in the destination module (DstM).
>
> That's very surprising to me and I'd like to understand it a bit more  (We're supposed to only ODR metadata).


Yes, but the metadata can refer to values, which getIdentifiedStructTypes() will walk when hunting for types. It was very surprising to me too :-)

> getIdentifiedStructTypes() isn't even documented in the Module header unfortunately. It is not clear off-hand it the issue should be handled in the IRMover or in `getIdentifiedStructTypes` itself.

I'm not sure how we'd change getIdentifiedStructTypes() though. Once we've ODR'd the metadata, the module now refers to a value with this type, and it makes sense that getIdentifiedStructTypes() finds it.


https://reviews.llvm.org/D26212





More information about the llvm-commits mailing list