From 7c19ab17c722288f47dfc887dec0405814bf304d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Sat, 22 Feb 2014 16:59:24 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenModule.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') 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()) { + B.addAttribute(llvm::Attribute::NoDuplicate); } else if (D->hasAttr()) { B.addAttribute(llvm::Attribute::NoInline); } else if ((D->hasAttr() || -- cgit v1.2.3