[clang] [llvm] [RISCV] Teach .option arch to support experimental extensions. (PR #89727)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 22:55:27 PDT 2024


================
@@ -2824,8 +2827,12 @@ bool RISCVAsmParser::parseDirectiveOption() {
         break;
       }
 
-      auto Ext = llvm::lower_bound(RISCVFeatureKV, Arch);
-      if (Ext == std::end(RISCVFeatureKV) || StringRef(Ext->Key) != Arch ||
+      std::string &&Feature = RISCVISAInfo::getTargetFeatureForExtension(Arch);
----------------
topperc wrote:

I think you should just use `std::string Feature`. I think `std::string &&Feature` will just make a reference to a hidden temporary object.

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


More information about the llvm-commits mailing list