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

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 23:48:47 PST 2024


================
@@ -840,6 +886,33 @@ 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 auto *FoundProfile =
+        llvm::find_if(SupportedProfiles, [&](const RISCVProfile &Profile) {
+          return Arch.starts_with(Profile.Name);
+        });
+
+    if (FoundProfile == adl_end(SupportedProfiles))
----------------
topperc wrote:

Can we use std::end instead of adl_end?

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


More information about the cfe-commits mailing list