================
@@ -3040,6 +3040,11 @@ bool Sema::checkTargetVersionAttr(SourceLocation 
LiteralLoc, Decl *D,
   enum FirstParam { Unsupported };
   enum SecondParam { None };
   enum ThirdParam { Target, TargetClones, TargetVersion };
+
+  if (!Context.getTargetInfo().getTriple().isRISCV() &&
+      !Context.getTargetInfo().getTriple().isAArch64())
+    return Diag(LiteralLoc, diag::err_target_version_unsupported);
----------------
AaronBallman wrote:

A better way to handle this is to use `TargetSpecificAttr` for `TargetVersion` 
in `Attr.td` (instead of `InheritableAttr`). That should automatically handle 
performing this check and you won't need to add a custom diagnostic.

https://github.com/llvm/llvm-project/pull/115991
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to