summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2018-11-26 16:38:37 +0000
committerSander de Smalen <sander.desmalen@arm.com>2018-11-26 16:38:37 +0000
commit96b26a81f0d600a8f20d5791d9b11604b59fb3c2 (patch)
tree0622711418c28ef62720caaa8a7a68fead938ade /lib/Sema/SemaDeclAttr.cpp
parent699929e7c37245caa81685a6ba371305c91a9019 (diff)
downloadclang-96b26a81f0d600a8f20d5791d9b11604b59fb3c2.tar.gz
[AArch64] Add aarch64_vector_pcs function attribute to Clang
This is the Clang patch to complement the following LLVM patches: https://reviews.llvm.org/D51477 https://reviews.llvm.org/D51479 More information describing the vector ABI and procedure call standard can be found here: https://developer.arm.com/products/software-development-tools/\ hpc/arm-compiler-for-hpc/vector-function-abi Patch by Kerry McLaughlin. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D54425 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index b77b77d9ba..9f5325d109 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -4291,6 +4291,11 @@ static void handleCallConvAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
AL.getAttributeSpellingListIndex()));
return;
}
+ case ParsedAttr::AT_AArch64VectorPcs:
+ D->addAttr(::new(S.Context)
+ AArch64VectorPcsAttr(AL.getRange(), S.Context,
+ AL.getAttributeSpellingListIndex()));
+ return;
case ParsedAttr::AT_IntelOclBicc:
D->addAttr(::new (S.Context)
IntelOclBiccAttr(AL.getRange(), S.Context,
@@ -4368,6 +4373,9 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC,
case ParsedAttr::AT_VectorCall:
CC = CC_X86VectorCall;
break;
+ case ParsedAttr::AT_AArch64VectorPcs:
+ CC = CC_AArch64VectorCall;
+ break;
case ParsedAttr::AT_RegCall:
CC = CC_X86RegCall;
break;
@@ -5840,14 +5848,14 @@ static void handleDeprecatedAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
if (AL.isDeclspecAttribute() || AL.isCXX11Attribute())
checkAttributeAtMostNumArgs(S, AL, 1);
else if (AL.isArgExpr(1) && AL.getArgAsExpr(1) &&
- !S.checkStringLiteralArgumentAttr(AL, 1, Replacement))
- return;
-
- if (!S.getLangOpts().CPlusPlus14 && AL.isCXX11Attribute() && !AL.isGNUScope())
- S.Diag(AL.getLoc(), diag::ext_cxx14_attr) << AL;
-
- D->addAttr(::new (S.Context)
- DeprecatedAttr(AL.getRange(), S.Context, Str, Replacement,
+ !S.checkStringLiteralArgumentAttr(AL, 1, Replacement))
+ return;
+
+ if (!S.getLangOpts().CPlusPlus14 && AL.isCXX11Attribute() && !AL.isGNUScope())
+ S.Diag(AL.getLoc(), diag::ext_cxx14_attr) << AL;
+
+ D->addAttr(::new (S.Context)
+ DeprecatedAttr(AL.getRange(), S.Context, Str, Replacement,
AL.getAttributeSpellingListIndex()));
}
@@ -6493,6 +6501,7 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case ParsedAttr::AT_IntelOclBicc:
case ParsedAttr::AT_PreserveMost:
case ParsedAttr::AT_PreserveAll:
+ case ParsedAttr::AT_AArch64VectorPcs:
handleCallConvAttr(S, D, AL);
break;
case ParsedAttr::AT_Suppress: