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

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 15:47:59 PDT 2024


================
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D,
   enum SecondParam { None };
   enum ThirdParam { Target, TargetClones, TargetVersion };
   llvm::SmallVector<StringRef, 8> Features;
+  if (Context.getTargetInfo().getTriple().isRISCV()) {
+
+    llvm::SmallVector<StringRef, 8> AttrStrs;
+    AttrStr.split(AttrStrs, ';');
+
+    bool IsPriority = false;
+    bool IsDefault = false;
+    for (auto &AttrStr : AttrStrs) {
+      // Only support arch=+ext,... syntax.
----------------
topperc wrote:

What if someone writes `arch=rv64gc;default;` do we error for that?

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


More information about the cfe-commits mailing list