Add ms_abi and sysv_abi attribute handling.
Based on a patch by Benno Rice!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189644 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 92935ae..2bf56c7 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -3950,6 +3950,16 @@
PascalAttr(Attr.getRange(), S.Context,
Attr.getAttributeSpellingListIndex()));
return;
+ case AttributeList::AT_MSABI:
+ D->addAttr(::new (S.Context)
+ MSABIAttr(Attr.getRange(), S.Context,
+ Attr.getAttributeSpellingListIndex()));
+ return;
+ case AttributeList::AT_SysVABI:
+ D->addAttr(::new (S.Context)
+ SysVABIAttr(Attr.getRange(), S.Context,
+ Attr.getAttributeSpellingListIndex()));
+ return;
case AttributeList::AT_Pcs: {
PcsAttr::PCSType PCS;
switch (CC) {
@@ -4024,6 +4034,14 @@
case AttributeList::AT_StdCall: CC = CC_X86StdCall; break;
case AttributeList::AT_ThisCall: CC = CC_X86ThisCall; break;
case AttributeList::AT_Pascal: CC = CC_X86Pascal; break;
+ case AttributeList::AT_MSABI:
+ CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_C :
+ CC_X86_64Win64;
+ break;
+ case AttributeList::AT_SysVABI:
+ CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_X86_64SysV :
+ CC_C;
+ break;
case AttributeList::AT_Pcs: {
Expr *Arg = attr.getArg(0);
StringLiteral *Str = dyn_cast<StringLiteral>(Arg);
@@ -4869,6 +4887,8 @@
case AttributeList::AT_FastCall:
case AttributeList::AT_ThisCall:
case AttributeList::AT_Pascal:
+ case AttributeList::AT_MSABI:
+ case AttributeList::AT_SysVABI:
case AttributeList::AT_Pcs:
case AttributeList::AT_PnaclCall:
case AttributeList::AT_IntelOclBicc: