LLVM
15.0.0git
|
Utility to embed an integer into a pointer-like type. More...
#include "llvm/ADT/PointerEmbeddedInt.h"
Public Member Functions | |
PointerEmbeddedInt ()=default | |
PointerEmbeddedInt (IntT I) | |
PointerEmbeddedInt & | operator= (IntT I) |
operator IntT () const | |
Friends | |
struct | PointerLikeTypeTraits< PointerEmbeddedInt > |
Utility to embed an integer into a pointer-like type.
This is specifically intended to allow embedding integers where fewer bits are required than exist in a pointer, and the integer can participate in abstractions along side other pointer-like types. For example it can be placed into a PointerSumType
or PointerUnion
.
Note that much like pointers, an integer value of zero has special utility due to boolean conversions. For example, a non-null value can be tested for in the above abstractions without testing the particular active member. Also, the default constructed value zero initializes the integer.
Definition at line 33 of file PointerEmbeddedInt.h.
|
default |
|
inline |
Definition at line 61 of file PointerEmbeddedInt.h.
References I.
|
inline |
Definition at line 72 of file PointerEmbeddedInt.h.
References Shift.
|
inline |
Definition at line 63 of file PointerEmbeddedInt.h.
|
friend |
Definition at line 54 of file PointerEmbeddedInt.h.