[clang] [llvm] [RISCV] Deduplicate RISCVISAInfo::toFeatures/toFeatureVector. NFC (PR #76942)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 7 22:05:33 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
----------------
lukel97 wrote:
This was just copied from the previous function, but would non-RISCV developers need to read RISCVISAInfo.cpp? (Still happy to add a link to the spec if you would prefer)
https://github.com/llvm/llvm-project/pull/76942
More information about the llvm-commits
mailing list