[PATCH] D43595: WIP alternative to r325686 (Implement name based structure type mapping).

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 07:13:39 PST 2018


evgeny777 added inline comments.


================
Comment at: lib/Linker/IRMover.cpp:1459
+    if (auto *GV = dyn_cast<GlobalValue>(&V))
+      GV->mutateValueType(TypeMap.get(GV->getValueType()));
+    if (auto *I = dyn_cast<GetElementPtrInst>(&V)) {
----------------
You're mutating types while processing values in the module. This looks dangerous and actually triggers assertion when your patch is used to link real application (I can provide details and even test case, if you like). Can you do this in two steps instead:

- create a list of objects you want to swap types for
- process this list after TypeMap is fully filled.


https://reviews.llvm.org/D43595





More information about the llvm-commits mailing list