From 4c209c7e1f649f3c6a545a9c843a151acc8c8ce9 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 11 Feb 2015 18:50:13 +0000 Subject: Add a comdat to __clang_call_terminate llvm-svn: 228863 --- clang/lib/CodeGen/CGException.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CGException.cpp') diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index a632a40e14a..9df4f977318 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -1564,6 +1564,8 @@ static llvm::Constant *getClangCallTerminateFn(CodeGenModule &CGM) { // we don't want it to turn into an exported symbol. fn->setLinkage(llvm::Function::LinkOnceODRLinkage); fn->setVisibility(llvm::Function::HiddenVisibility); + if (CGM.supportsCOMDAT()) + fn->setComdat(CGM.getModule().getOrInsertComdat(fn->getName())); // Set up the function. llvm::BasicBlock *entry = -- cgit v1.2.3