15 #ifndef LLVM_CLANG_BASIC_VERSIONTUPLE_H 16 #define LLVM_CLANG_BASIC_VERSIONTUPLE_H 19 #include "llvm/ADT/Optional.h" 29 unsigned UsesUnderscores : 1;
32 unsigned HasMinor : 1;
34 unsigned Subminor : 31;
35 unsigned HasSubminor : 1;
38 unsigned HasBuild : 1;
42 : Major(0), UsesUnderscores(
false), Minor(0), HasMinor(
false),
43 Subminor(0), HasSubminor(
false), Build(0), HasBuild(
false) {}
46 : Major(Major), UsesUnderscores(
false), Minor(0), HasMinor(
false),
47 Subminor(0), HasSubminor(
false), Build(0), HasBuild(
false) {}
50 bool UsesUnderscores =
false)
51 : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor),
52 HasMinor(
true), Subminor(0), HasSubminor(
false), Build(0),
55 explicit VersionTuple(
unsigned Major,
unsigned Minor,
unsigned Subminor,
56 bool UsesUnderscores =
false)
57 : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor),
58 HasMinor(
true), Subminor(Subminor), HasSubminor(
true), Build(0),
61 explicit VersionTuple(
unsigned Major,
unsigned Minor,
unsigned Subminor,
62 unsigned Build,
bool UsesUnderscores =
false)
63 : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor),
64 HasMinor(
true), Subminor(Subminor), HasSubminor(
true), Build(Build),
70 return Major == 0 && Minor == 0 && Subminor == 0 && Build == 0;
98 return UsesUnderscores;
102 UsesUnderscores =
false;
108 return X.Major == Y.Major && X.Minor == Y.Minor &&
109 X.Subminor == Y.Subminor && X.Build == Y.Build;
125 return std::tie(X.Major, X.Minor, X.Subminor, X.Build) <
126 std::tie(Y.Major, Y.Minor, Y.Subminor, Y.Build);
168 #endif // LLVM_CLANG_BASIC_VERSIONTUPLE_H friend bool operator>(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number follows another.
Optional< unsigned > getBuild() const
Retrieve the build version number, if provided.
Represents a version number in the form major[.minor[.subminor[.build]]].
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
VersionTuple(unsigned Major, unsigned Minor, bool UsesUnderscores=false)
bool usesUnderscores() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
VersionTuple(unsigned Major)
friend bool operator==(const VersionTuple &X, const VersionTuple &Y)
Determine if two version numbers are equivalent.
Optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, bool UsesUnderscores=false)
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 or is equivalent to another.
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero)...
VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, unsigned Build, bool UsesUnderscores=false)
Dataflow Directional Tag Classes.
Optional< unsigned > getSubminor() const
Retrieve the subminor version number, if provided.
bool tryParse(StringRef string)
Try to parse the given string as a version number.
unsigned getMajor() const
Retrieve the major version number.
std::string getAsString() const
Retrieve a string representation of the version number.
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
friend bool operator<(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes another.
friend bool operator<=(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes or is equivalent to another.