summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-02-22 16:59:24 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-02-22 16:59:24 +0000
commit7c19ab17c722288f47dfc887dec0405814bf304d (patch)
treea90abcc93e28e1d24c4025be0d2ba931b264d6c5 /clang/lib/CodeGen/CodeGenModule.cpp
parent9d2c15eff7edd220a3246ebedd2e502051e49844 (diff)
downloadbcm5719-llvm-7c19ab17c722288f47dfc887dec0405814bf304d.tar.gz
bcm5719-llvm-7c19ab17c722288f47dfc887dec0405814bf304d.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index bbf5a730f07..e6798e49a85 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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>() ||
OpenPOWER on IntegriCloud