[llvm] [clang] [RISCV] Deduplicate RISCVISAInfo::toFeatures/toFeatureVector. NFC (PR #76942)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 15:55:04 PST 2024


================
@@ -466,35 +466,37 @@ bool RISCVISAInfo::compareExtension(const std::string &LHS,
   return LHS < RHS;
 }
 
-void RISCVISAInfo::toFeatures(
-    std::vector<StringRef> &Features,
-    llvm::function_ref<StringRef(const Twine &)> StrAlloc,
-    bool AddAllExtensions) const {
+std::vector<std::string> RISCVISAInfo::toFeatures(bool AddAllExtensions,
+                                                  bool IgnoreUnknown) const {
+  std::vector<std::string> Features;
   for (auto const &Ext : Exts) {
-    StringRef ExtName = Ext.first;
+    std::string ExtName = Ext.first;
----------------
topperc wrote:

Use StringRef here and only convert to std::string when we concatenate?

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


More information about the cfe-commits mailing list