diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-15 20:17:08 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-15 20:17:08 +0000 |
| commit | 3931c28b031c08bc1880b43ef5f530dae81b9b06 (patch) | |
| tree | 43b3325424b499985382db5a3cad43d0bfeb0ef2 /llvm/lib | |
| parent | 64fa12372caafcad988db1737291674ad505080b (diff) | |
| download | bcm5719-llvm-3931c28b031c08bc1880b43ef5f530dae81b9b06.tar.gz bcm5719-llvm-3931c28b031c08bc1880b43ef5f530dae81b9b06.zip | |
Set comdats when lazily linking functions.
We were setting the comdat when functions were copied in the initial pass, but
not when they were linked only when we found out that they are needed.
llvm-svn: 215765
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 5 |
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; } |

