[PATCH] D21255: Fix cloning GlobalValues with comdats across Modules.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 12:28:22 PDT 2016

majnemer added a comment.

In http://reviews.llvm.org/D21255#459019, @jlebar wrote:

> > I like the idea of asserting in setParent
> Okay, this doesn't quite work.  You can assert in setParent, but it doesn't make sense to assert there but not inside copyAttributesFrom.  But if we assert in copyAttributesFrom, that means that the IRLinker needs to be changed so that the GlobalValue it copies into is not in a module.  And changing that looks nontrivial (and contrived).
> I guess we could leave the assertion in place and add a new function, copyAttributesExceptComdatFrom.  We'd have to make this one virtual and make copyAttributesFrom non-virtual.  Not sure how I feel about that...

How about let's just remove the COMDAT machinations from copyAttributesFrom.  Maybe provide another mechanism for comdats.


More information about the llvm-commits mailing list