[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

Piyou Chen via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 14 22:37:52 PST 2024


================
@@ -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);
----------------
BeMg wrote:

Great idea. This patch now uses the TargetSpecificAttr to enable target_version for AArch64 and RISC-V.

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


More information about the cfe-commits mailing list