LLVM: include/llvm/TextAPI/PackedVersion.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_TEXTAPI_PACKEDVERSION_H
14#define LLVM_TEXTAPI_PACKEDVERSION_H
15
18#include
19#include
20#include
21
22namespace llvm {
25
27
30
31public:
34 PackedVersion(unsigned Major, unsigned Minor, unsigned Subminor)
35 : Version((Major << 16) | ((Minor & 0xff) << 8) | (Subminor & 0xff)) {}
36
38 unsigned Minor = 0, Subminor = 0;
39 if (auto VTMinor = VT.getMinor())
40 Minor = *VTMinor;
42 Subminor = *VTSub;
44 }
45
46 bool empty() const { return Version == 0; }
47
48
49 unsigned getMajor() const { return Version >> 16; }
50
51
52 unsigned getMinor() const { return (Version >> 8) & 0xff; }
53
54
55 unsigned getSubminor() const { return Version & 0xff; }
56
59
61
63
65
67
68 LLVM_ABI operator std::string() const;
69
71};
72
77
78}
79}
80
81#endif
Defines the llvm::VersionTuple class, which represents a version in the form major[....
Definition PackedVersion.h:28
bool operator==(const PackedVersion &O) const
Definition PackedVersion.h:62
LLVM_ABI void print(raw_ostream &OS) const
unsigned getMinor() const
Retrieve the minor version number, if provided.
Definition PackedVersion.h:52
LLVM_ABI bool parse32(StringRef Str)
constexpr PackedVersion()=default
LLVM_ABI std::pair< bool, bool > parse64(StringRef Str)
bool operator!=(const PackedVersion &O) const
Definition PackedVersion.h:64
PackedVersion(unsigned Major, unsigned Minor, unsigned Subminor)
Definition PackedVersion.h:34
constexpr PackedVersion(uint32_t RawVersion)
Definition PackedVersion.h:33
PackedVersion(VersionTuple VT)
Definition PackedVersion.h:37
uint32_t rawValue() const
Definition PackedVersion.h:66
bool empty() const
Definition PackedVersion.h:46
unsigned getSubminor() const
Retrieve the subminor version number, if provided.
Definition PackedVersion.h:55
unsigned getMajor() const
Retrieve the major version number.
Definition PackedVersion.h:49
bool operator<(const PackedVersion &O) const
Definition PackedVersion.h:60
StringRef - Represent a constant reference to a string, i.e.
Represents a version number in the form major[.minor[.subminor[.build]]].
unsigned getMajor() const
Retrieve the major version number.
std::optional< unsigned > getSubminor() const
Retrieve the subminor version number, if provided.
std::optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
This class implements an extremely fast bulk output stream that can only output to a stream.
LLVM_ABI raw_ostream & operator<<(raw_ostream &OS, Architecture Arch)
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t Version