LLVM 17.0.0git
|
Represents a version number in the form major[.minor[.subminor[.build]]]. More...
#include "llvm/Support/VersionTuple.h"
Public Member Functions | |
constexpr | VersionTuple () |
constexpr | VersionTuple (unsigned Major) |
constexpr | VersionTuple (unsigned Major, unsigned Minor) |
constexpr | VersionTuple (unsigned Major, unsigned Minor, unsigned Subminor) |
constexpr | VersionTuple (unsigned Major, unsigned Minor, unsigned Subminor, unsigned Build) |
bool | empty () const |
Determine whether this version information is empty (e.g., all version components are zero). | |
unsigned | getMajor () const |
Retrieve the major version number. | |
std::optional< unsigned > | getMinor () const |
Retrieve the minor version number, if provided. | |
std::optional< unsigned > | getSubminor () const |
Retrieve the subminor version number, if provided. | |
std::optional< unsigned > | getBuild () const |
Retrieve the build version number, if provided. | |
VersionTuple | withoutBuild () const |
Return a version tuple that contains only the first 3 version components. | |
VersionTuple | withMajorReplaced (unsigned NewMajor) const |
Return a version tuple that contains a different major version but everything else is the same. | |
VersionTuple | normalize () const |
Return a version tuple that contains only components that are non-zero. | |
std::string | getAsString () const |
Retrieve a string representation of the version number. | |
bool | tryParse (StringRef string) |
Try to parse the given string as a version number. | |
Friends | |
bool | operator== (const VersionTuple &X, const VersionTuple &Y) |
Determine if two version numbers are equivalent. | |
bool | operator!= (const VersionTuple &X, const VersionTuple &Y) |
Determine if two version numbers are not equivalent. | |
bool | operator< (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number precedes another. | |
bool | operator> (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number follows another. | |
bool | operator<= (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number precedes or is equivalent to another. | |
bool | operator>= (const VersionTuple &X, const VersionTuple &Y) |
Determine whether one version number follows or is equivalent to another. | |
hash_code | hash_value (const VersionTuple &VT) |
template<typename HasherT , llvm::support::endianness Endianness> | |
void | addHash (HashBuilderImpl< HasherT, Endianness > &HBuilder, const VersionTuple &VT) |
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition at line 31 of file VersionTuple.h.
|
inlineconstexpr |
Definition at line 44 of file VersionTuple.h.
Referenced by tryParse(), withMajorReplaced(), and withoutBuild().
|
inlineexplicitconstexpr |
Definition at line 48 of file VersionTuple.h.
|
inlineexplicitconstexpr |
Definition at line 52 of file VersionTuple.h.
|
inlineexplicitconstexpr |
Definition at line 56 of file VersionTuple.h.
|
inlineexplicitconstexpr |
Definition at line 61 of file VersionTuple.h.
|
inline |
Determine whether this version information is empty (e.g., all version components are zero).
Definition at line 68 of file VersionTuple.h.
Referenced by EmitSDKVersionSuffix(), llvm::MachO::getTargetTripleName(), getWindowsSDKDirViaCommandLine(), and targetVersionOrMinimumSupportedOSVersion().
std::string VersionTuple::getAsString | ( | ) | const |
Retrieve a string representation of the version number.
Definition at line 21 of file VersionTuple.cpp.
Referenced by llvm::MachO::getTargetTripleName(), and getWindowsSDKDirViaCommandLine().
|
inline |
Retrieve the build version number, if provided.
Definition at line 90 of file VersionTuple.h.
|
inline |
Retrieve the major version number.
Definition at line 73 of file VersionTuple.h.
Referenced by llvm::dxil::createShaderModelMD(), EmitSDKVersionSuffix(), llvm::Triple::getOSMajorVersion(), getWindowsSDKDirViaCommandLine(), llvm::AArch64::ArchInfo::implies(), and llvm::dxil::ValidatorVersionMD::update().
|
inline |
Retrieve the minor version number, if provided.
Definition at line 76 of file VersionTuple.h.
Referenced by llvm::dxil::createShaderModelMD(), EmitSDKVersionSuffix(), llvm::AArch64::ArchInfo::implies(), and llvm::dxil::ValidatorVersionMD::update().
|
inline |
Retrieve the subminor version number, if provided.
Definition at line 83 of file VersionTuple.h.
Referenced by EmitSDKVersionSuffix().
|
inline |
Return a version tuple that contains only components that are non-zero.
Definition at line 110 of file VersionTuple.h.
Try to parse the given string as a version number.
true
if the string does not match the regular expression [0-9]+(.[0-9]+){0,3} Definition at line 63 of file VersionTuple.cpp.
References llvm::StringRef::empty(), parseInt(), llvm::StringRef::substr(), and VersionTuple().
Referenced by getHighestNumericTupleInDirectory(), and getWindowsSDKDirViaCommandLine().
|
inline |
Return a version tuple that contains a different major version but everything else is the same.
Definition at line 105 of file VersionTuple.h.
References VersionTuple().
|
inline |
Return a version tuple that contains only the first 3 version components.
Definition at line 97 of file VersionTuple.h.
References VersionTuple().
|
friend |
Definition at line 178 of file VersionTuple.h.
|
friend |
Definition at line 173 of file VersionTuple.h.
|
friend |
Determine if two version numbers are not equivalent.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 134 of file VersionTuple.h.
|
friend |
Determine whether one version number precedes another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 142 of file VersionTuple.h.
|
friend |
Determine whether one version number precedes or is equivalent to another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 160 of file VersionTuple.h.
|
friend |
Determine if two version numbers are equivalent.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 125 of file VersionTuple.h.
|
friend |
Determine whether one version number follows another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 151 of file VersionTuple.h.
|
friend |
Determine whether one version number follows or is equivalent to another.
If not provided, minor and subminor version numbers are considered to be zero.
Definition at line 169 of file VersionTuple.h.