aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorKerry McLaughlin <kerry.mclaughlin@arm.com>2025-01-10 09:54:48 +0000
committerGitHub <noreply@github.com>2025-01-10 09:54:48 +0000
commit4e32271e8b304eb018c69f74c16edd1668fcdaf3 (patch)
tree0ba77f907509619b300df5b8c44166df1cd47f37 /clang/lib/Sema/SemaLambda.cpp
parent4c853be6673fd95b4b900a6c0e1804bf33a0629c (diff)
downloadllvm-4e32271e8b304eb018c69f74c16edd1668fcdaf3.zip
llvm-4e32271e8b304eb018c69f74c16edd1668fcdaf3.tar.gz
llvm-4e32271e8b304eb018c69f74c16edd1668fcdaf3.tar.bz2
[AArch64][SME] Add diagnostics for SME attributes on lambda functions (#121777)
CheckFunctionDeclaration emits diagnostics if any SME attributes are used by a function definition without the required +sme or +sme2 target features. This patch moves these diagnostics to a new function in SemaARM and also adds a call to this from ActOnStartOfLambdaDefinition.
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index f2c3a81..0c5467c 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -21,6 +21,7 @@
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
+#include "clang/Sema/SemaARM.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaOpenMP.h"
@@ -1455,6 +1456,9 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
// Attributes on the lambda apply to the method.
ProcessDeclAttributes(CurScope, Method, ParamInfo);
+ if (Context.getTargetInfo().getTriple().isAArch64())
+ ARM().CheckSMEFunctionDefAttributes(Method);
+
// CUDA lambdas get implicit host and device attributes.
if (getLangOpts().CUDA)
CUDA().SetLambdaAttrs(Method);