LLVM  10.0.0svn
Public Member Functions | Friends | List of all members
llvm::Align Struct Reference

This struct is a compact representation of a valid (non-zero power of two) alignment. More...

#include "llvm/Support/Alignment.h"

Public Member Functions

 Align ()=default
 Default is byte-aligned. More...
 
 Align (const Align &Other)=default
 Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other. More...
 
Alignoperator= (const Align &Other)=default
 
 Align (Align &&Other)=default
 
Alignoperator= (Align &&Other)=default
 
 Align (uint64_t Value)
 
uint64_t value () const
 This is a hole in the type system and should not be abused. More...
 

Friends

struct MaybeAlign
 The log2 of the required alignment. More...
 
unsigned Log2 (Align)
 Returns the log2 of the alignment. More...
 
bool operator== (Align Lhs, Align Rhs)
 Comparisons operators between Align. More...
 
bool operator!= (Align Lhs, Align Rhs)
 
bool operator<= (Align Lhs, Align Rhs)
 
bool operator>= (Align Lhs, Align Rhs)
 
bool operator< (Align Lhs, Align Rhs)
 
bool operator> (Align Lhs, Align Rhs)
 
unsigned encode (struct MaybeAlign A)
 Returns a representation of the alignment that encodes undefined as 0. More...
 
struct MaybeAlign decodeMaybeAlign (unsigned Value)
 Dual operation of the encode function above. More...
 

Detailed Description

This struct is a compact representation of a valid (non-zero power of two) alignment.

It is suitable for use as static global constants.

Definition at line 40 of file Alignment.h.

Constructor & Destructor Documentation

◆ Align() [1/4]

llvm::Align::Align ( )
default

◆ Align() [2/4]

llvm::Align::Align ( const Align Other)
default

Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other.

◆ Align() [3/4]

llvm::Align::Align ( Align &&  Other)
default

◆ Align() [4/4]

llvm::Align::Align ( uint64_t  Value)
inlineexplicit

Definition at line 66 of file Alignment.h.

References assert(), llvm::isPowerOf2_64(), and llvm::Log2_64().

Member Function Documentation

◆ operator=() [1/2]

Align& llvm::Align::operator= ( const Align Other)
default

◆ operator=() [2/2]

Align& llvm::Align::operator= ( Align &&  Other)
default

◆ value()

uint64_t llvm::Align::value ( ) const
inline

Friends And Related Function Documentation

◆ decodeMaybeAlign

struct MaybeAlign decodeMaybeAlign ( unsigned  Value)
friend

Dual operation of the encode function above.

Definition at line 178 of file Alignment.h.

◆ encode

unsigned encode ( struct MaybeAlign  A)
friend

Returns a representation of the alignment that encodes undefined as 0.

Definition at line 175 of file Alignment.h.

Referenced by llvm::encode().

◆ Log2

unsigned Log2 ( Align  A)
friend

Returns the log2 of the alignment.

Definition at line 143 of file Alignment.h.

Referenced by llvm::Log2().

◆ MaybeAlign

friend struct MaybeAlign
friend

The log2 of the required alignment.

ShiftValue is less than 64 by construction.

Definition at line 45 of file Alignment.h.

Referenced by llvm::commonAlignment(), llvm::decodeMaybeAlign(), llvm::encode(), and llvm::operator/().

◆ operator!=

bool operator!= ( Align  Lhs,
Align  Rhs 
)
friend

Definition at line 248 of file Alignment.h.

◆ operator<

bool operator< ( Align  Lhs,
Align  Rhs 
)
friend

Definition at line 257 of file Alignment.h.

◆ operator<=

bool operator<= ( Align  Lhs,
Align  Rhs 
)
friend

Definition at line 251 of file Alignment.h.

◆ operator==

bool operator== ( Align  Lhs,
Align  Rhs 
)
friend

Comparisons operators between Align.

Definition at line 245 of file Alignment.h.

◆ operator>

bool operator> ( Align  Lhs,
Align  Rhs 
)
friend

Definition at line 260 of file Alignment.h.

◆ operator>=

bool operator>= ( Align  Lhs,
Align  Rhs 
)
friend

Definition at line 254 of file Alignment.h.


The documentation for this struct was generated from the following file: