diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index fa9697ec51e..1802d2b5cd6 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -806,8 +806,9 @@ 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())); + if (CGF.CGM.supportsCOMDAT()) + CGF.CurFn->setComdat( + CGF.CGM.getModule().getOrInsertComdat(CGF.CurFn->getName())); // Call the unsized deallocation function and forward the first argument // unchanged. |