Exposing the noduplicate attribute within Clang, which marks functions so that the optimizer does not duplicate code.

Patch thanks to Marcello Maggioni!

llvm-svn: 201941
This commit is contained in:
Aaron Ballman
2014-02-22 16:59:24 +00:00
parent 9d2c15eff7
commit 7c19ab17c7
8 changed files with 128 additions and 1 deletions

View File

@@ -631,6 +631,8 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
// Naked implies noinline: we should not be inlining such functions.
B.addAttribute(llvm::Attribute::Naked);
B.addAttribute(llvm::Attribute::NoInline);
} else if (D->hasAttr<NoDuplicateAttr>()) {
B.addAttribute(llvm::Attribute::NoDuplicate);
} else if (D->hasAttr<NoInlineAttr>()) {
B.addAttribute(llvm::Attribute::NoInline);
} else if ((D->hasAttr<AlwaysInlineAttr>() ||