diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-11 00:26:26 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-11 00:26:26 +0000 |
| commit | 0ee986c1f12b111fd20f21149940d668ac52d462 (patch) | |
| tree | b626710652e0e271d2561694dc6dfd05f473050d /clang/lib/CodeGen | |
| parent | 3904343c68926f1ed8250e4a9b0863868f1ffb74 (diff) | |
| download | bcm5719-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.cpp | 3 |
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) |

