Add comdat to thunks.

llvm-svn: 226465
This commit is contained in:
Rafael Espindola
2015-01-19 14:02:14 +00:00
parent b8039074d0
commit f9b1730d41
2 changed files with 7 additions and 4 deletions

View File

@@ -377,7 +377,10 @@ void CodeGenFunction::GenerateThunk(llvm::Function *Fn,
// Set the right linkage.
CGM.setFunctionLinkage(GD, Fn);
if (CGM.supportsCOMDAT() && Fn->isWeakForLinker())
Fn->setComdat(CGM.getModule().getOrInsertComdat(Fn->getName()));
// Set the right visibility.
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
setThunkVisibility(CGM, MD, Thunk, Fn);