From 0ee986c1f12b111fd20f21149940d668ac52d462 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. llvm-svn: 123197 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index f582238..5d549c9 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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.1