summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 1970e7fa069..5c26b2610b1 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -546,6 +546,11 @@ Value *ValueMaterializerTy::materializeValueFor(Value *V) {
SF->getLinkage(), SF->getName(), DstM);
copyGVAttributes(DF, SF);
+ if (Comdat *SC = SF->getComdat()) {
+ Comdat *DC = DstM->getOrInsertComdat(SC->getName());
+ DF->setComdat(DC);
+ }
+
LazilyLinkFunctions.push_back(SF);
return DF;
}
OpenPOWER on IntegriCloud