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

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 17:25:28 PST 2016


mehdi_amini accepted this revision.
mehdi_amini added a reviewer: mehdi_amini.
mehdi_amini added a comment.
This revision is now accepted and ready to land.

LGTM.

I looked into how to put named type on Modules, but that has large implication (for example cloning a function from one module to another would now require special handling to remap named types).
Also before LLVM 3.0 type didn't have name, the names were kept on the side in a hash table on the module, having the current behavior has been a careful choice: http://blog.llvm.org/2011/11/llvm-30-type-system-rewrite.html



================
Comment at: lib/Linker/IRMover.cpp:707
+      // getIdentifiedStructTypes() can have found it by walking debug info
+      // metadata nodes, some of which get linked by name, from the source to
+      // the destination module.
----------------
`some of which get linked by name` add `when ODR Type Uniquing is enabled on the Context`


https://reviews.llvm.org/D26212





More information about the llvm-commits mailing list