10 #include "llvm/ADT/StringRef.h"
15 if (!name.consume_front(
"gfx"))
22 unsigned stepping = 0;
24 StringRef majorRef = name.drop_back(2);
25 StringRef minorRef = name.take_back(2).drop_back(1);
26 StringRef steppingRef = name.take_back(1);
27 if (majorRef.getAsInteger(10, major))
29 if (minorRef.getAsInteger(16, minor))
31 if (steppingRef.getAsInteger(16, stepping))
33 return Chipset(major, minor, stepping);
static FailureOr< Chipset > parse(StringRef name)
Parses the chipset version string and returns the chipset on success, and failure otherwise.
constexpr Chipset()=default