[PATCH] D157270: [Clang][AArch64] Add diagnostic for calls from non-ZA to shared-ZA functions.

Richard Sandiford via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 7 06:48:13 PDT 2023


rsandifo-arm added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:6737
+        else if (const auto *FPT = CallerFD->getType()->getAs<FunctionProtoType>())
+          CallerHasZAState |= FPT->getExtProtoInfo().AArch64SMEAttributes &
+                              FunctionType::SME_PStateZASharedMask;
----------------
Very minor, but it looked odd to me to have `|=` in this statement and `=` above.


================
Comment at: clang/test/Sema/aarch64-sme-func-attrs.c:181
 
+void non_za_definition(void) {
+  sme_arm_new_za(); // OK
----------------
Would be good to have some tests for indirect function calls too (via function pointers), to make sure that the diagnostic still works when no decl is available.

I suppose this applies to D157269 too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157270/new/

https://reviews.llvm.org/D157270



More information about the cfe-commits mailing list