[PATCH] D14623: [ThinLTO] Comdat importing fixes and related cleanup

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 09:35:57 PST 2015


davidxl added inline comments.

================
Comment at: lib/Linker/LinkModules.cpp:944
@@ +943,3 @@
+  // ValueMap for SGV.
+  if (DGV && NewGV != DGV) {
+    DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewGV, DGV->getType()));
----------------
A more general question -- why can't the attributes etc from Src GV be merged into Dst GV instead of creating a clone?

================
Comment at: lib/Linker/LinkModules.cpp:1704
@@ +1703,3 @@
+           "Found remaining member of stripped comdat");
+  for (Function &DF : *DstM)
+    assert(!StrippedComdats.count(DF.getComdat()) &&
----------------
This brings up the same question why the clone is needed in the first place..


http://reviews.llvm.org/D14623





More information about the llvm-commits mailing list