aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-02-22 19:24:35 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-02-22 19:24:35 +0000
commit4c67aa96401b67b5200e701cff87485067ab0792 (patch)
treeba20c266d6c80cbdfd3372a01aa9f3b9dc78662b /lib/CodeGen
parent0b849d34b3a9574615e98e108db4e8099e9032e0 (diff)
Add support for coldcc to clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGCall.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 9fd31fe253..f2c2d0a85d 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -37,6 +37,7 @@ using namespace CodeGen;
static unsigned ClangCallConvToLLVMCallConv(CallingConv CC) {
switch (CC) {
default: return llvm::CallingConv::C;
+ case CC_Cold: return llvm::CallingConv::Cold;
case CC_X86StdCall: return llvm::CallingConv::X86_StdCall;
case CC_X86FastCall: return llvm::CallingConv::X86_FastCall;
case CC_X86ThisCall: return llvm::CallingConv::X86_ThisCall;
@@ -135,6 +136,9 @@ CodeGenTypes::arrangeFreeFunctionType(CanQual<FunctionProtoType> FTP) {
static CallingConv getCallingConventionForDecl(const Decl *D) {
// Set the appropriate calling convention for the Function.
+ if (D->hasAttr<ColdCCAttr>())
+ return CC_Cold;
+
if (D->hasAttr<StdCallAttr>())
return CC_X86StdCall;