summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
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
commit0ee986c1f12b111fd20f21149940d668ac52d462 (patch)
treeb626710652e0e271d2561694dc6dfd05f473050d /clang/lib/CodeGen
parent3904343c68926f1ed8250e4a9b0863868f1ffb74 (diff)
downloadbcm5719-llvm-0ee986c1f12b111fd20f21149940d668ac52d462.tar.gz
bcm5719-llvm-0ee986c1f12b111fd20f21149940d668ac52d462.zip
Add unnamed_addr to constructors and destructors.
llvm-svn: 123197
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index f582238456e..5d549c91964 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<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)
OpenPOWER on IntegriCloud