From 4ec360683539f0b9ca68d6b2e2935965a2b25665 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Tue, 13 Jun 2017 21:14:07 +0000 Subject: Preserve cold attribute for function decls Differential Revision: http://reviews.llvm.org/D34133 llvm-svn: 305325 --- clang/lib/CodeGen/CGCall.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CGCall.cpp') diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 07906473358..c65dc18be30 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1795,6 +1795,8 @@ void CodeGenModule::ConstructAttributeList( FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); if (TargetDecl->hasAttr()) FuncAttrs.addAttribute(llvm::Attribute::NoReturn); + if (TargetDecl->hasAttr()) + FuncAttrs.addAttribute(llvm::Attribute::Cold); if (TargetDecl->hasAttr()) FuncAttrs.addAttribute(llvm::Attribute::NoDuplicate); if (TargetDecl->hasAttr()) -- cgit v1.2.3