15 #ifndef LLVM_SUPPORT_VERSIONTUPLE_H 16 #define LLVM_SUPPORT_VERSIONTUPLE_H 31 unsigned HasMinor : 1;
33 unsigned Subminor : 31;
34 unsigned HasSubminor : 1;
37 unsigned HasBuild : 1;
41 : Major(0), Minor(0), HasMinor(
false), Subminor(0), HasSubminor(
false),
42 Build(0), HasBuild(
false) {}
45 : Major(Major), Minor(0), HasMinor(
false), Subminor(0),
46 HasSubminor(
false), Build(0), HasBuild(
false) {}
49 : Major(Major), Minor(Minor), HasMinor(
true), Subminor(0),
50 HasSubminor(
false), Build(0), HasBuild(
false) {}
52 explicit VersionTuple(
unsigned Major,
unsigned Minor,
unsigned Subminor)
53 : Major(Major), Minor(Minor), HasMinor(
true), Subminor(Subminor),
54 HasSubminor(
true), Build(0), HasBuild(
false) {}
56 explicit VersionTuple(
unsigned Major,
unsigned Minor,
unsigned Subminor,
58 : Major(Major), Minor(Minor), HasMinor(
true), Subminor(Subminor),
59 HasSubminor(
true), Build(Build), HasBuild(
true) {}
64 return Major == 0 && Minor == 0 && Subminor == 0 && Build == 0;
94 return X.Major == Y.Major && X.Minor == Y.Minor &&
95 X.Subminor == Y.Subminor && X.Build == Y.Build;
111 return std::tie(X.Major, X.Minor, X.Subminor, X.Build) <
112 std::tie(Y.Major, Y.Minor, Y.Subminor, Y.Build);
154 #endif // LLVM_SUPPORT_VERSIONTUPLE_H VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, unsigned Build)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This class represents lattice values for constants.
VersionTuple(unsigned Major, unsigned Minor)
block Block Frequency true
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
friend bool operator!=(const VersionTuple &X, const VersionTuple &Y)
Determine if two version numbers are not equivalent.
friend bool operator>(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number follows another.
VersionTuple(unsigned Major)
friend bool operator==(const VersionTuple &X, const VersionTuple &Y)
Determine if two version numbers are equivalent.
friend bool operator>=(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number follows or is equivalent to another.
friend bool operator<=(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes or is equivalent to another.
unsigned getMajor() const
Retrieve the major version number.
friend bool operator<(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes another.
VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor)
Optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
bool tryParse(StringRef string)
Try to parse the given string as a version number.
Optional< unsigned > getBuild() const
Retrieve the build version number, if provided.
Represents a version number in the form major[.minor[.subminor[.build]]].
std::string getAsString() const
Retrieve a string representation of the version number.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
Optional< unsigned > getSubminor() const
Retrieve the subminor version number, if provided.
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero)...