LLVM 20.0.0git
Public Member Functions | List of all members
llvm::MaybeAlign Struct Reference

This struct is a compact representation of a valid (power of two) or undefined (0) alignment. More...

#include "llvm/Support/Alignment.h"

Inheritance diagram for llvm::MaybeAlign:
Inheritance graph
[legend]

Public Member Functions

 MaybeAlign ()=default
 Default is undefined.
 
 MaybeAlign (const MaybeAlign &Other)=default
 Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other.
 
MaybeAlignoperator= (const MaybeAlign &Other)=default
 
 MaybeAlign (MaybeAlign &&Other)=default
 
MaybeAlignoperator= (MaybeAlign &&Other)=default
 
constexpr MaybeAlign (std::nullopt_t None)
 
constexpr MaybeAlign (Align Value)
 
 MaybeAlign (uint64_t Value)
 
Align valueOrOne () const
 For convenience, returns a valid alignment or 1 if undefined.
 

Detailed Description

This struct is a compact representation of a valid (power of two) or undefined (0) alignment.

Definition at line 117 of file Alignment.h.

Constructor & Destructor Documentation

◆ MaybeAlign() [1/6]

llvm::MaybeAlign::MaybeAlign ( )
default

Default is undefined.

◆ MaybeAlign() [2/6]

llvm::MaybeAlign::MaybeAlign ( const MaybeAlign Other)
default

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

◆ MaybeAlign() [3/6]

llvm::MaybeAlign::MaybeAlign ( MaybeAlign &&  Other)
default

◆ MaybeAlign() [4/6]

constexpr llvm::MaybeAlign::MaybeAlign ( std::nullopt_t  None)
inlineconstexpr

Definition at line 131 of file Alignment.h.

◆ MaybeAlign() [5/6]

constexpr llvm::MaybeAlign::MaybeAlign ( Align  Value)
inlineconstexpr

Definition at line 132 of file Alignment.h.

◆ MaybeAlign() [6/6]

llvm::MaybeAlign::MaybeAlign ( uint64_t  Value)
inlineexplicit

Definition at line 133 of file Alignment.h.

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

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ valueOrOne()

Align llvm::MaybeAlign::valueOrOne ( ) const
inline

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