aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
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/Sema/SemaDeclAttr.cpp
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/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 5f6f81de14..d764bee097 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -3859,6 +3859,11 @@ static void handleCallConvAttr(Sema &S, Decl *D, const AttributeList &Attr) {
}
switch (Attr.getKind()) {
+ case AttributeList::AT_ColdCC:
+ D->addAttr(::new (S.Context)
+ ColdCCAttr(Attr.getRange(), S.Context,
+ Attr.getAttributeSpellingListIndex()));
+ return;
case AttributeList::AT_FastCall:
D->addAttr(::new (S.Context)
FastCallAttr(Attr.getRange(), S.Context,
@@ -3939,6 +3944,7 @@ bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC,
// move to TargetAttributesSema one day.
switch (attr.getKind()) {
case AttributeList::AT_CDecl: CC = CC_C; break;
+ case AttributeList::AT_ColdCC: CC = CC_Cold; break;
case AttributeList::AT_FastCall: CC = CC_X86FastCall; break;
case AttributeList::AT_StdCall: CC = CC_X86StdCall; break;
case AttributeList::AT_ThisCall: CC = CC_X86ThisCall; break;
@@ -3971,6 +3977,9 @@ bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC,
default: llvm_unreachable("unexpected attribute kind");
}
+ if (!isTargetSpecific(CC))
+ return false;
+
const TargetInfo &TI = Context.getTargetInfo();
TargetInfo::CallingConvCheckResult A = TI.checkCallingConvention(CC);
if (A == TargetInfo::CCCR_Warning) {
@@ -4774,6 +4783,7 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
break;
case AttributeList::AT_StdCall:
case AttributeList::AT_CDecl:
+ case AttributeList::AT_ColdCC:
case AttributeList::AT_FastCall:
case AttributeList::AT_ThisCall:
case AttributeList::AT_Pascal: