================
@@ -854,6 +895,30 @@ 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;
+ if (IsProfile) {
+ const auto *FoundProfile =
+ llvm::find_if(SupportedProfiles, [&](const RISCVProfile &Profile) {
+ return Arch.starts_with(Profile.Name);
+ });
+
+ if (FoundProfile == std::end(SupportedProfiles))
+ return createStringError(errc::invalid_argument, "unsupported profile");
+
+ NewArch = FoundProfile->MArch;
----------------
michaelmaitland wrote:
Do you need to declare `std::string NewArch;` above or can you introduce it
here since it is not used above?
https://github.com/llvm/llvm-project/pull/76357
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits