29struct RISCVSupportedExtension {
34 bool operator<(
const RISCVSupportedExtension &RHS)
const {
47 "i",
"m",
"a",
"f",
"d",
"zicsr",
"zifencei"
50#define GET_SUPPORTED_EXTENSIONS
51#include "llvm/TargetParser/RISCVTargetParserDef.inc"
53#define GET_SUPPORTED_PROFILES
54#include "llvm/TargetParser/RISCVTargetParserDef.inc"
58 static std::atomic<bool> TableChecked(
false);
59 if (!TableChecked.load(std::memory_order_relaxed)) {
61 "Extensions are not sorted by name");
63 "Experimental extensions are not sorted by name");
64 TableChecked.store(
true, std::memory_order_relaxed);
72 unsigned VersionWidth = Description.
empty() ? 0 : 10;
74 << Description <<
"\n";
79 outs() <<
"All available -march extensions for RISC-V\n\n";
83 for (
const auto &E : SupportedExtensions)
84 ExtMap[E.Name] = {E.Version.Major, E.Version.Minor};
85 for (
const auto &E : ExtMap) {
87 std::to_string(E.second.Major) +
"." + std::to_string(E.second.Minor);
91 outs() <<
"\nExperimental extensions\n";
93 for (
const auto &E : SupportedExperimentalExtensions)
94 ExtMap[E.Name] = {E.Version.Major, E.Version.Minor};
95 for (
const auto &E : ExtMap) {
97 std::to_string(E.second.Major) +
"." + std::to_string(E.second.Minor);
98 PrintExtension(E.first, Version, DescMap[
"experimental-" + E.first]);
101 outs() <<
"\nUse -march to specify the target's extension.\n"
102 "For example, clang -march=rv32i_v1p0\n";
106 return Ext.consume_front(
"experimental-");
118 "Already guarded by if-statement in ::parseArchString");
120 int Pos = Ext.size() - 1;
121 while (Pos > 0 &&
isDigit(Ext[Pos]))
123 if (Pos > 0 && Ext[Pos] ==
'p' &&
isDigit(Ext[Pos - 1])) {
125 while (Pos > 0 &&
isDigit(Ext[Pos]))
133 bool operator()(
const RISCVSupportedExtension &LHS,
StringRef RHS) {
136 bool operator()(
StringRef LHS,
const RISCVSupportedExtension &RHS) {
142static std::optional<RISCVISAUtils::ExtensionVersion>
146 for (
auto &ExtInfo : {
ArrayRef(SupportedExtensions),
147 ArrayRef(SupportedExperimentalExtensions)}) {
150 if (
I == ExtInfo.end() ||
I->Name != ExtName)
158void RISCVISAInfo::addExtension(
StringRef ExtName,
164 if (Ext.starts_with(
"s"))
165 return "standard supervisor-level extension";
166 if (Ext.starts_with(
"x"))
167 return "non-standard user-level extension";
168 if (Ext.starts_with(
"z"))
169 return "standard user-level extension";
174 if (Ext.starts_with(
"s"))
176 if (Ext.starts_with(
"x"))
178 if (Ext.starts_with(
"z"))
183static std::optional<RISCVISAUtils::ExtensionVersion>
187 if (
I == std::end(SupportedExperimentalExtensions) ||
I->Name != Ext)
197 IsExperimental ?
ArrayRef(SupportedExperimentalExtensions)
201 return I != ExtInfo.
end() &&
I->Name == Ext;
207 for (
auto ExtInfo : {
ArrayRef(SupportedExtensions),
208 ArrayRef(SupportedExperimentalExtensions)}) {
210 if (
I != ExtInfo.end() &&
I->Name == Ext)
218 unsigned MinorVersion) {
219 for (
auto ExtInfo : {
ArrayRef(SupportedExtensions),
220 ArrayRef(SupportedExperimentalExtensions)}) {
222 std::equal_range(ExtInfo.begin(), ExtInfo.end(), Ext, LessExtName());
223 for (
auto I = Range.first, E = Range.second;
I != E; ++
I)
224 if (
I->Version.Major == MajorVersion &&
I->Version.Minor == MinorVersion)
237 return Exts.count(Ext.str()) != 0;
241 bool IgnoreUnknown)
const {
242 std::vector<std::string> Features;
243 for (
const auto &[ExtName,
_] : Exts) {
253 Features.push_back((
llvm::Twine(
"+experimental-") + ExtName).str());
255 Features.push_back((
llvm::Twine(
"+") + ExtName).str());
258 if (AddAllExtensions) {
259 for (
const RISCVSupportedExtension &Ext : SupportedExtensions) {
260 if (Exts.count(Ext.Name))
262 Features.push_back((
llvm::Twine(
"-") + Ext.Name).str());
265 for (
const RISCVSupportedExtension &Ext : SupportedExperimentalExtensions) {
266 if (Exts.count(Ext.Name))
268 Features.push_back((
llvm::Twine(
"-experimental-") + Ext.Name).str());
275 if (ExtName.size() == 1) {
277 "unsupported standard user-level extension '" +
282 " '" + ExtName +
"'");
291 unsigned &Minor,
unsigned &ConsumeLength,
292 bool EnableExperimentalExtension,
293 bool ExperimentalExtensionVersionCheck) {
298 MajorStr = In.take_while(
isDigit);
299 In = In.substr(MajorStr.
size());
301 if (!MajorStr.
empty() && In.consume_front(
"p")) {
302 MinorStr = In.take_while(
isDigit);
303 In = In.substr(MajorStr.
size() + MinorStr.
size() - 1);
306 if (MinorStr.
empty()) {
309 "minor version number missing after 'p' for extension '" + Ext +
"'");
316 "Failed to parse major version number for extension '" + Ext +
"'");
321 "Failed to parse minor version number for extension '" + Ext +
"'");
323 ConsumeLength = MajorStr.
size();
325 if (!MinorStr.
empty())
326 ConsumeLength += MinorStr.
size() + 1 ;
331 if (Ext.size() > 1 && In.size())
334 "multi-character extensions must be separated by underscores");
338 if (!EnableExperimentalExtension)
340 "requires '-menable-experimental-extensions' "
341 "for experimental extension '" +
344 if (ExperimentalExtensionVersionCheck &&
348 "experimental extension requires explicit version number `" + Ext +
351 auto SupportedVers = *ExperimentalExtension;
352 if (ExperimentalExtensionVersionCheck &&
353 (Major != SupportedVers.Major || Minor != SupportedVers.Minor)) {
354 std::string
Error =
"unsupported version number " + MajorStr.
str();
355 if (!MinorStr.
empty())
357 Error +=
" for experimental extension '" + Ext.str() +
358 "' (this compiler supports " + utostr(SupportedVers.Major) +
359 "." + utostr(SupportedVers.Minor) +
")";
372 Major = DefaultVersion->Major;
373 Minor = DefaultVersion->Minor;
386 std::string
Error =
"unsupported version number " + std::string(MajorStr);
387 if (!MinorStr.
empty())
389 Error +=
" for extension '" + Ext.str() +
"'";
395 const std::vector<std::string> &Features) {
396 assert(XLen == 32 || XLen == 64);
397 std::unique_ptr<RISCVISAInfo> ISAInfo(
new RISCVISAInfo(XLen));
399 for (
auto &Feature : Features) {
401 assert(ExtName.
size() > 1 && (ExtName[0] ==
'+' || ExtName[0] ==
'-'));
402 bool Add = ExtName[0] ==
'+';
405 auto ExtensionInfos = Experimental
406 ?
ArrayRef(SupportedExperimentalExtensions)
408 auto ExtensionInfoIterator =
413 if (ExtensionInfoIterator == ExtensionInfos.end() ||
414 ExtensionInfoIterator->Name != ExtName)
418 ISAInfo->addExtension(ExtName, ExtensionInfoIterator->Version);
420 ISAInfo->Exts.erase(ExtName.
str());
430 "string must be lowercase");
439 if (XLen == 0 || Arch.
empty() || (Arch[0] !=
'i' && Arch[0] !=
'e'))
441 "arch string must begin with valid base ISA");
443 std::unique_ptr<RISCVISAInfo> ISAInfo(
new RISCVISAInfo(XLen));
449 Arch.
split(Split,
'_');
452 std::tie(Prefix, MinorVersionStr) = Ext.rsplit(
'p');
453 if (MinorVersionStr.
empty())
455 "extension lacks version in expected format");
456 unsigned MajorVersion, MinorVersion;
459 "failed to parse minor version number");
463 int TrailingDigits = 0;
465 while (!ExtName.
empty()) {
473 "extension lacks version in expected format");
475 StringRef MajorVersionStr = Prefix.take_back(TrailingDigits);
478 "failed to parse major version number");
479 ISAInfo->addExtension(ExtName, {MajorVersion, MinorVersion});
481 ISAInfo->updateFLen();
482 ISAInfo->updateMinVLen();
483 ISAInfo->updateMaxELen();
484 return std::move(ISAInfo);
488 std::vector<std::string> &SplitExts) {
493 Exts.
split(Split,
"_");
495 for (
auto Ext : Split) {
498 "extension name missing after separator '_'");
500 SplitExts.push_back(Ext.str());
508 std::map<std::string, unsigned>> &SeenExtMap,
509 bool IgnoreUnknown,
bool EnableExperimentalExtension,
510 bool ExperimentalExtensionVersionCheck) {
521 "invalid extension prefix '" + RawExt +
"'");
524 if (!IgnoreUnknown &&
Name.size() ==
Type.size())
526 Desc +
" name missing after '" +
Type +
"'");
528 unsigned Major, Minor, ConsumeLength;
530 EnableExperimentalExtension,
531 ExperimentalExtensionVersionCheck)) {
540 if (!IgnoreUnknown && SeenExtMap.contains(
Name.str()))
542 "duplicated " +
Desc +
" '" +
Name +
"'");
547 SeenExtMap[
Name.str()] = {Major, Minor};
554 std::map<std::string, unsigned>> &SeenExtMap,
555 bool IgnoreUnknown,
bool EnableExperimentalExtension,
556 bool ExperimentalExtensionVersionCheck) {
557 unsigned Major, Minor, ConsumeLength;
561 EnableExperimentalExtension,
562 ExperimentalExtensionVersionCheck)) {
565 RawExt = RawExt.
substr(ConsumeLength);
571 RawExt = RawExt.
substr(ConsumeLength);
574 if (!IgnoreUnknown && SeenExtMap.contains(
Name.str()))
576 "duplicated standard user-level extension '" +
582 SeenExtMap[
Name.str()] = {Major, Minor};
588 bool ExperimentalExtensionVersionCheck,
589 bool IgnoreUnknown) {
593 "string must be lowercase");
597 const auto *FoundProfile =
602 if (FoundProfile == std::end(SupportedProfiles))
605 std::string NewArch = FoundProfile->MArch.str();
607 if (!ArchWithoutProfile.
empty()) {
611 "additional extensions must be after separator '_'");
612 NewArch += ArchWithoutProfile.
str();
615 ExperimentalExtensionVersionCheck, IgnoreUnknown);
625 if (XLen == 0 || Arch.
empty())
628 "string must begin with rv32{i,e,g} or rv64{i,e,g}");
630 std::unique_ptr<RISCVISAInfo> ISAInfo(
new RISCVISAInfo(XLen));
632 std::map<std::string, unsigned>>
637 char Baseline = Arch.
front();
643 "first letter after \'rv" +
Twine(XLen) +
644 "\' should be 'e', 'i' or 'g'");
652 "version not supported for 'g'");
656 if (Arch.
back() ==
'_')
658 "extension name missing after separator '_'");
663 unsigned Major, Minor, ConsumeLength;
664 if (Baseline ==
'g') {
673 assert(Version &&
"Default extension version not found?");
675 SeenExtMap[Ext] = {Version->Major, Version->Minor};
680 StringRef(&Baseline, 1), Exts, Major, Minor, ConsumeLength,
681 EnableExperimentalExtension, ExperimentalExtensionVersionCheck)) {
688 Major = Version->Major;
689 Minor = Version->Minor;
693 SeenExtMap[
StringRef(&Baseline, 1).
str()] = {Major, Minor};
701 std::vector<std::string> SplitExts;
705 for (
auto &Ext : SplitExts) {
707 while (!CurrExt.
empty()) {
710 CurrExt, SeenExtMap, IgnoreUnknown, EnableExperimentalExtension,
711 ExperimentalExtensionVersionCheck))
713 }
else if (CurrExt.
front() ==
'z' || CurrExt.
front() ==
's' ||
714 CurrExt.
front() ==
'x') {
724 CurrExt, SeenExtMap, IgnoreUnknown, EnableExperimentalExtension,
725 ExperimentalExtensionVersionCheck))
733 "invalid standard user-level extension '" +
740 for (
auto &SeenExtAndVers : SeenExtMap) {
741 const std::string &ExtName = SeenExtAndVers.first;
746 ISAInfo->addExtension(ExtName, ExtVers);
752Error RISCVISAInfo::checkDependency() {
753 bool HasC = Exts.count(
"c") != 0;
754 bool HasF = Exts.count(
"f") != 0;
755 bool HasZfinx = Exts.count(
"zfinx") != 0;
756 bool HasVector = Exts.count(
"zve32x") != 0;
757 bool HasZvl = MinVLen != 0;
758 bool HasZcmt = Exts.count(
"zcmt") != 0;
760 if (HasF && HasZfinx)
762 "'f' and 'zfinx' extensions are incompatible");
764 if (HasZvl && !HasVector)
767 "'zvl*b' requires 'v' or 'zve*' extension to also be specified");
769 if (Exts.count(
"zvbb") && !HasVector)
772 "'zvbb' requires 'v' or 'zve*' extension to also be specified");
774 if (Exts.count(
"zvbc") && !Exts.count(
"zve64x"))
777 "'zvbc' requires 'v' or 'zve64*' extension to also be specified");
779 if ((Exts.count(
"zvkb") || Exts.count(
"zvkg") || Exts.count(
"zvkned") ||
780 Exts.count(
"zvknha") || Exts.count(
"zvksed") || Exts.count(
"zvksh")) &&
784 "'zvk*' requires 'v' or 'zve*' extension to also be specified");
786 if (Exts.count(
"zvknhb") && !Exts.count(
"zve64x"))
789 "'zvknhb' requires 'v' or 'zve64*' extension to also be specified");
791 if ((HasZcmt || Exts.count(
"zcmp")) && Exts.count(
"d") &&
792 (HasC || Exts.count(
"zcd")))
795 Twine(
"'") + (HasZcmt ?
"zcmt" :
"zcmp") +
796 "' extension is incompatible with '" + (HasC ?
"c" :
"zcd") +
797 "' extension when 'd' extension is enabled");
799 if (XLen != 32 && Exts.count(
"zcf"))
801 "'zcf' is only supported for 'rv32'");
803 if (Exts.count(
"zacas") && !(Exts.count(
"a") || Exts.count(
"zamo")))
806 "'zacas' requires 'a' or 'zaamo' extension to also be specified");
808 if (Exts.count(
"zabha") && !(Exts.count(
"a") || Exts.count(
"zamo")))
811 "'zabha' requires 'a' or 'zaamo' extension to also be specified");
833#define GET_IMPLIED_EXTENSIONS
834#include "llvm/TargetParser/RISCVTargetParserDef.inc"
836void RISCVISAInfo::updateImplication() {
837 bool HasE = Exts.count(
"e") != 0;
838 bool HasI = Exts.count(
"i") != 0;
842 if (!HasE && !HasI) {
844 addExtension(
"i", Version.value());
852 for (
auto const &Ext : Exts)
853 WorkList.
insert(Ext.first);
855 while (!WorkList.
empty()) {
857 auto Range = std::equal_range(std::begin(ImpliedExts),
858 std::end(ImpliedExts), ExtName);
859 std::for_each(Range.first, Range.second,
861 const char *ImpliedExt = Implied.ImpliedExt;
862 if (WorkList.count(ImpliedExt))
864 if (Exts.count(ImpliedExt))
866 auto Version = findDefaultVersion(ImpliedExt);
867 addExtension(ImpliedExt, Version.value());
868 WorkList.insert(ImpliedExt);
873 if (XLen == 32 && Exts.count(
"zce") && Exts.count(
"f") &&
874 !Exts.count(
"zcf")) {
876 addExtension(
"zcf", Version.value());
881 {
"zk"}, {
"zkn"}, {
"zks"}, {
"zvkn"}, {
"zvknc"},
882 {
"zvkng"}, {
"zvks"}, {
"zvksc"}, {
"zvksg"},
885void RISCVISAInfo::updateCombination() {
886 bool MadeChange =
false;
895 auto Range = std::equal_range(std::begin(ImpliedExts),
896 std::end(ImpliedExts), CombineExt);
897 bool HasAllRequiredFeatures = std::all_of(
899 return hasExtension(Implied.ImpliedExt);
901 if (HasAllRequiredFeatures) {
903 addExtension(CombineExt,
Version.value());
907 }
while (MadeChange);
910void RISCVISAInfo::updateFLen() {
915 else if (Exts.count(
"f"))
919void RISCVISAInfo::updateMinVLen() {
920 for (
auto const &Ext : Exts) {
926 MinVLen = std::max(MinVLen, ZvlLen);
931void RISCVISAInfo::updateMaxELen() {
932 assert(MaxELenFp == 0 && MaxELen == 0);
933 if (Exts.count(
"v")) {
934 MaxELenFp = std::max(MaxELenFp, 64u);
935 MaxELen = std::max(MaxELen, 64u);
939 for (
auto const &Ext : Exts) {
943 if (ExtName.
back() ==
'f')
944 MaxELenFp = std::max(MaxELenFp, 32u);
945 else if (ExtName.
back() ==
'd')
946 MaxELenFp = std::max(MaxELenFp, 64u);
947 else if (ExtName.
back() !=
'x')
953 MaxELen = std::max(MaxELen, ZveELen);
962 Arch <<
"rv" << XLen;
964 ListSeparator LS(
"_");
965 for (
auto const &Ext : Exts) {
967 auto ExtInfo = Ext.second;
968 Arch << LS << ExtName;
969 Arch << ExtInfo.Major <<
"p" << ExtInfo.Minor;
977 ISAInfo->updateImplication();
978 ISAInfo->updateCombination();
979 ISAInfo->updateFLen();
980 ISAInfo->updateMinVLen();
981 ISAInfo->updateMaxELen();
983 if (
Error Result = ISAInfo->checkDependency())
984 return std::move(Result);
985 return std::move(ISAInfo);
997 }
else if (XLen == 64) {
1019 unsigned Major, Minor, ConsumeLength;
1031 return std::string();
1037 return std::string();
1040 return std::string();
std::optional< std::vector< StOtherPiece > > Other
This file implements a map that provides insertion order iteration.
static void verifyTables()
static StringRef getExtensionTypeDesc(StringRef Ext)
static Error processSingleLetterExtension(StringRef &RawExt, MapVector< std::string, RISCVISAUtils::ExtensionVersion, std::map< std::string, unsigned > > &SeenExtMap, bool IgnoreUnknown, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck)
static std::optional< RISCVISAUtils::ExtensionVersion > findDefaultVersion(StringRef ExtName)
static size_t findLastNonVersionCharacter(StringRef Ext)
static StringRef getExtensionType(StringRef Ext)
static constexpr StringLiteral CombineIntoExts[]
static bool stripExperimentalPrefix(StringRef &Ext)
static Error processMultiLetterExtension(StringRef RawExt, MapVector< std::string, RISCVISAUtils::ExtensionVersion, std::map< std::string, unsigned > > &SeenExtMap, bool IgnoreUnknown, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck)
static std::optional< RISCVISAUtils::ExtensionVersion > isExperimentalExtension(StringRef Ext)
static void PrintExtension(StringRef Name, StringRef Version, StringRef Description)
static bool operator<(const ImpliedExtsEntry &LHS, StringRef RHS)
static Error getExtensionVersion(StringRef Ext, StringRef In, unsigned &Major, unsigned &Minor, unsigned &ConsumeLength, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck)
static const char * RISCVGImplications[]
static Error getStringErrorForInvalidExt(std::string_view ExtName)
static Error splitExtsByUnderscore(StringRef Exts, std::vector< std::string > &SplitExts)
static bool isDigit(const char C)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file implements a set that has insertion order iteration characteristics.
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
static void verifyTables()
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
This class implements a map that also provides access to all stored values in a deterministic order.
static bool isSupportedExtensionFeature(StringRef Ext)
static std::string getTargetFeatureForExtension(StringRef Ext)
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseNormalizedArchString(StringRef Arch)
Parse RISC-V ISA info from an arch string that is already in normalized form (as defined in the psABI...
bool hasExtension(StringRef Ext) const
std::string toString() const
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > postProcessAndChecking(std::unique_ptr< RISCVISAInfo > &&ISAInfo)
StringRef computeDefaultABI() const
static bool isSupportedExtension(StringRef Ext)
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseFeatures(unsigned XLen, const std::vector< std::string > &Features)
Parse RISC-V ISA info from feature vector.
std::vector< std::string > toFeatures(bool AddAllExtensions=false, bool IgnoreUnknown=true) const
Convert RISC-V ISA info to a feature vector.
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseArchString(StringRef Arch, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck=true, bool IgnoreUnknown=false)
Parse RISC-V ISA info from arch string.
static bool isSupportedExtensionWithVersion(StringRef Ext)
bool empty() const
Determine if the SetVector is empty or not.
bool insert(const value_type &X)
Insert a new element into the SetVector.
value_type pop_back_val()
A SetVector that performs no allocations if smaller than a certain size.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
bool consume_back(StringRef Suffix)
Returns true if this StringRef has the given suffix and removes that suffix.
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
std::string str() const
str - Get the contents as an std::string.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
empty - Check if the string is empty.
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
char back() const
back - Get the last character in the string.
constexpr size_t size() const
size - Get the string size.
char front() const
front - Get the first character in the string.
bool consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
A raw_ostream that writes to an std::string.
std::string & str()
Returns the string's reference.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr StringLiteral AllStdExts
std::map< std::string, ExtensionVersion, ExtensionComparator > OrderedExtensionMap
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension.
This is an optimization pass for GlobalISel generic memory operations.
bool operator<(int64_t V1, const APSInt &V2)
raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
bool is_sorted(R &&Range, Compare C)
Wrapper function around std::is_sorted to check if elements in a range R are sorted with respect to a...
void riscvExtensionsHelp(StringMap< StringRef > DescMap)
FormattedString left_justify(StringRef Str, unsigned Width)
left_justify - append spaces after string so total output is Width characters.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
void consumeError(Error Err)
Consume a Error without doing anything.
bool operator<(const ImpliedExtsEntry &Other) const
Description of the encoding of one expression Op.
Represents the major and version number components of a RISC-V extension.