[clang] [RISCV][FMV] Support target_version (PR #99040)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 10:54:45 PDT 2024


================
@@ -11028,7 +11029,14 @@ static bool CheckMultiVersionValue(Sema &S, const FunctionDecl *FD) {
 
   if (TVA) {
     llvm::SmallVector<StringRef, 8> Feats;
-    TVA->getFeatures(Feats);
+    if (S.getASTContext().getTargetInfo().getTriple().isRISCV()) {
+      ParsedTargetAttr ParseInfo =
+          S.getASTContext().getTargetInfo().parseTargetAttr(TVA->getName());
+      for (auto &Feat : ParseInfo.Features)
+        Feats.push_back(StringRef{Feat}.substr(1));
+    } else {
+      TVA->getFeatures(Feats);
----------------
topperc wrote:

Assert isAArch64 here

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


More information about the cfe-commits mailing list