29 SplitString(Str, Parts,
".");
34 unsigned long long Num;
43 for (
unsigned i = 1, ShiftNum = 8; i < Parts.
size(); ++i, ShiftNum -= 8) {
50 Version |= (Num << ShiftNum);
57 bool Truncated =
false;
61 return std::make_pair(
false, Truncated);
64 SplitString(Str, Parts,
".");
67 return std::make_pair(
false, Truncated);
69 unsigned long long Num;
71 return std::make_pair(
false, Truncated);
73 if (Num > 0xFFFFFFULL)
74 return std::make_pair(
false, Truncated);
76 if (Num > 0xFFFFULL) {
82 for (
unsigned i = 1, ShiftNum = 8; i < Parts.
size() && i < 3;
85 return std::make_pair(
false, Truncated);
88 return std::make_pair(
false, Truncated);
94 Version |= (Num << ShiftNum);
100 return std::make_pair(
true, Truncated);
103PackedVersion::operator std::string()
const {
107 return std::string(Str);
This file defines the SmallVector class.
void print(raw_ostream &OS) const
unsigned getMinor() const
Retrieve the minor version number, if provided.
bool parse32(StringRef Str)
std::pair< bool, bool > parse64(StringRef Str)
unsigned getSubminor() const
Retrieve the subminor version number, if provided.
unsigned getMajor() const
Retrieve the major version number.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
This is an optimization pass for GlobalISel generic memory operations.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
bool getAsUnsignedInteger(StringRef Str, unsigned Radix, unsigned long long &Result)
Helper functions for StringRef::getAsInteger.