summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorRoman Levenstein <rlevenstein@apple.com>2016-03-16 18:00:46 +0000
committerRoman Levenstein <rlevenstein@apple.com>2016-03-16 18:00:46 +0000
commit35aa5cecf25162f4a88cdf1dbfe3f8fc3ed1a91c (patch)
treecd10e5f88885e6322f34eff7c85816a107616cbc /clang/lib/Sema/SemaDeclAttr.cpp
parentbe37e62e0ceb6ba6777b8bd50924a4cc4cfa3f7d (diff)
downloadbcm5719-llvm-35aa5cecf25162f4a88cdf1dbfe3f8fc3ed1a91c.tar.gz
bcm5719-llvm-35aa5cecf25162f4a88cdf1dbfe3f8fc3ed1a91c.zip
Add attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end
Till now, preserve_mostcc/preserve_allcc calling convention attributes were only available at the LLVM IR level. This patch adds attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end. The code was mostly written by Juergen Ributzka. I just added support for the AArch64 target and tests. Differential Revision: http://reviews.llvm.org/D18025 llvm-svn: 263647
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 0cae52a299f..725b08a422a 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -3799,7 +3799,14 @@ static void handleCallConvAttr(Sema &S, Decl *D, const AttributeList &Attr) {
IntelOclBiccAttr(Attr.getRange(), S.Context,
Attr.getAttributeSpellingListIndex()));
return;
-
+ case AttributeList::AT_PreserveMost:
+ D->addAttr(::new (S.Context) PreserveMostAttr(
+ Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex()));
+ return;
+ case AttributeList::AT_PreserveAll:
+ D->addAttr(::new (S.Context) PreserveAllAttr(
+ Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex()));
+ return;
default:
llvm_unreachable("unexpected attribute kind");
}
@@ -3857,6 +3864,8 @@ bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC,
return true;
}
case AttributeList::AT_IntelOclBicc: CC = CC_IntelOclBicc; break;
+ case AttributeList::AT_PreserveMost: CC = CC_PreserveMost; break;
+ case AttributeList::AT_PreserveAll: CC = CC_PreserveAll; break;
default: llvm_unreachable("unexpected attribute kind");
}
@@ -5655,6 +5664,8 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case AttributeList::AT_SysVABI:
case AttributeList::AT_Pcs:
case AttributeList::AT_IntelOclBicc:
+ case AttributeList::AT_PreserveMost:
+ case AttributeList::AT_PreserveAll:
handleCallConvAttr(S, D, Attr);
break;
case AttributeList::AT_OpenCLKernel:
OpenPOWER on IntegriCloud