From c5f657fe308f22243f674fc1dfbe24915944d8bf Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 11 Jan 2011 00:26:26 +0000 Subject: Add unnamed_addr to constructors and destructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123197 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index f582238456..5d549c9196 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -433,6 +433,9 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, if (D->hasAttr()) F->addFnAttr(llvm::Attribute::NoInline); + if (isa(D) || isa(D)) + F->setUnnamedAddr(true); + if (Features.getStackProtectorMode() == LangOptions::SSPOn) F->addFnAttr(llvm::Attribute::StackProtect); else if (Features.getStackProtectorMode() == LangOptions::SSPReq) -- cgit v1.2.3-70-g09d2