diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-02-22 16:59:24 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-02-22 16:59:24 +0000 |
commit | 16381d3390498c39def1db3d528121c7b06809fa (patch) | |
tree | e1b782c01d7fb71cf3d5e14b34f9487f85940619 /lib/CodeGen/CodeGenModule.cpp | |
parent | 3d8ada65463bb8f60bfa08964050e40eab1caa36 (diff) | |
download | clang-16381d3390498c39def1db3d528121c7b06809fa.tar.gz clang-16381d3390498c39def1db3d528121c7b06809fa.tar.bz2 clang-16381d3390498c39def1db3d528121c7b06809fa.tar.xz |
Exposing the noduplicate attribute within Clang, which marks functions so that the optimizer does not duplicate code.
Patch thanks to Marcello Maggioni!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index bbf5a730f0..e6798e49a8 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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>() || |