[clang] [llvm] [RISCV] Deduplicate RISCVISAInfo::toFeatures/toFeatureVector. NFC (PR #76942)
    Saleem Abdulrasool via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Fri Jan  5 08:04:31 PST 2024
    
    
  
================
@@ -466,35 +466,35 @@ 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 {
-  for (auto const &Ext : Exts) {
-    StringRef ExtName = Ext.first;
-
-    if (ExtName == "i")
+std::vector<std::string> RISCVISAInfo::toFeatures(bool AddAllExtensions,
+                                                  bool IgnoreUnknown) const {
+  std::vector<std::string> Features;
+  for (const auto &[ExtName, _] : Exts) {
+    if (ExtName == "i") // i is not recognized in clang -cc1
----------------
compnerd wrote:
Could you please add a comment explaining that this is the RVI i extension with a link to the spec?  I fear that non-RISCV developers might be confused by the random check for `i`.
https://github.com/llvm/llvm-project/pull/76942
    
    
More information about the cfe-commits
mailing list