[clang] [Clang][Sema] Emit diagnostic for __builtin_vectorelements(<SVEType>) when SVE is not available. (PR #168097)

Paul Walker via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 24 04:00:33 PST 2025


================
@@ -1685,4 +1685,24 @@ bool SemaARM::checkTargetClonesAttr(
   return false;
 }
 
+bool SemaARM::checkSVETypeSupport(QualType Ty, SourceLocation Loc,
+                                  const FunctionDecl *FD,
+                                  const llvm::StringMap<bool> &FeatureMap) {
+  if (!Ty->isSVESizelessBuiltinType())
+    return false;
+
+  if (FeatureMap.lookup("sve"))
+    return false;
+
+  // No SVE environment available.
+  if (!FeatureMap.lookup("sme"))
----------------
paulwalker-arm wrote:

I don't think so.  The SVE check is a positive one so if I fuse them as suggested I would still need the separate SVE check to bypass the later "is a streaming function" check.

https://github.com/llvm/llvm-project/pull/168097


More information about the cfe-commits mailing list