aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2024-01-15 09:41:32 +0000
committerGitHub <noreply@github.com>2024-01-15 09:41:32 +0000
commit8e7f073eb42c92aa7a2b651ca314d7fcebf296e3 (patch)
tree1b6b5ddd8c7c88a0228b65dcdb4f0ffec8639e1f /clang/lib/Parse/ParseDecl.cpp
parent06e3abcb54f339edc2ba757cfa947e024677b21e (diff)
downloadllvm-8e7f073eb42c92aa7a2b651ca314d7fcebf296e3.zip
llvm-8e7f073eb42c92aa7a2b651ca314d7fcebf296e3.tar.gz
llvm-8e7f073eb42c92aa7a2b651ca314d7fcebf296e3.tar.bz2
[Clang][AArch64] Change SME attributes for shared/new/preserved state. (#76971)
This patch replaces the `__arm_new_za`, `__arm_shared_za` and `__arm_preserves_za` attributes in favour of: * `__arm_new("za")` * `__arm_in("za")` * `__arm_out("za")` * `__arm_inout("za")` * `__arm_preserves("za")` As described in https://github.com/ARM-software/acle/pull/276. One change is that `__arm_in/out/inout/preserves(S)` are all mutually exclusive, whereas previously it was fine to write `__arm_shared_za __arm_preserves_za`. This case is now represented with `__arm_in("za")`. The current implementation uses the same LLVM attributes under the hood, since `__arm_in/out/inout` are all variations of "shared ZA", so can use the existing `aarch64_pstate_za_shared` attribute in LLVM. #77941 will add support for the new "zt0" state as introduced with SME2.
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index ed684c5d..8d856cc2 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -6791,7 +6791,13 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
} else if (Tok.isRegularKeywordAttribute()) {
// For consistency with attribute parsing.
Diag(Tok, diag::err_keyword_not_allowed) << Tok.getIdentifierInfo();
+ bool TakesArgs = doesKeywordAttributeTakeArgs(Tok.getKind());
ConsumeToken();
+ if (TakesArgs) {
+ BalancedDelimiterTracker T(*this, tok::l_paren);
+ if (!T.consumeOpen())
+ T.skipToEnd();
+ }
} else if (Tok.is(tok::kw_requires) && D.hasGroupingParens()) {
// This declarator is declaring a function, but the requires clause is
// in the wrong place: