aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-01-11 00:26:26 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-01-11 00:26:26 +0000
commitc5f657fe308f22243f674fc1dfbe24915944d8bf (patch)
tree5c678e1dbdee944d626939200888324bb4dc3a92 /lib/CodeGen/CodeGenModule.cpp
parent0024f940dd15987b8ffbe6e787dcf860a9ea1eff (diff)
Add unnamed_addr to constructors and destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
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<NoInlineAttr>())
F->addFnAttr(llvm::Attribute::NoInline);
+ if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
+ F->setUnnamedAddr(true);
+
if (Features.getStackProtectorMode() == LangOptions::SSPOn)
F->addFnAttr(llvm::Attribute::StackProtect);
else if (Features.getStackProtectorMode() == LangOptions::SSPReq)