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

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 11:42:58 PDT 2016


jlebar added a comment.

> 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...


http://reviews.llvm.org/D21255





More information about the llvm-commits mailing list