Put the implicit weak sized deallocation funciton in C++14 in a comdat

Fixes PR22635.

llvm-svn: 229913
This commit is contained in:
Reid Kleckner
2015-02-19 21:01:34 +00:00
parent cdaea4db26
commit 66abf2f92f
3 changed files with 6 additions and 4 deletions

View File

@@ -806,6 +806,8 @@ static void EmitSizedDeallocationFunction(CodeGenFunction &CGF,
const FunctionDecl *UnsizedDealloc) {
// This is a weak discardable definition of the sized deallocation function.
CGF.CurFn->setLinkage(llvm::Function::LinkOnceAnyLinkage);
CGF.CurFn->setComdat(
CGF.CGM.getModule().getOrInsertComdat(CGF.CurFn->getName()));
// Call the unsized deallocation function and forward the first argument
// unchanged.