[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 19 20:22:57 PST 2024


================
@@ -839,6 +860,36 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
                              "string must be lowercase");
   }
 
+  bool IsProfile = Arch.starts_with("rvi") || Arch.starts_with("rva") ||
+                   Arch.starts_with("rvb") || Arch.starts_with("rvm");
+  std::string NewArch;
+  std::string ProfileName;
+  if (IsProfile) {
+    const RISCVProfile *FoundProfile = nullptr;
+    for (const RISCVProfile &Profile : SupportedProfiles) {
----------------
topperc wrote:

find_if?

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


More information about the cfe-commits mailing list