Make forcesizeopt attribute available to the end user

llvm-svn: 166946
This commit is contained in:
Quentin Colombet
2012-10-29 17:56:23 +00:00
parent 2b86e48b3a
commit 0d6b5e5fde
4 changed files with 30 additions and 0 deletions

View File

@@ -583,6 +583,9 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
if (D->hasAttr<ColdAttr>())
F->addFnAttr(llvm::Attributes::OptimizeForSize);
if (D->hasAttr<ForceSizeOptAttr>())
F->addFnAttr(llvm::Attributes::ForceSizeOpt);
if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
F->setUnnamedAddr(true);