LLVM  10.0.0svn
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]
Collaboration diagram for llvm::MaybeAlign:
Collaboration graph
[legend]

Public Member Functions

 MaybeAlign ()=default
 Default is undefined. More...
 
 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. More...
 
MaybeAlignoperator= (const MaybeAlign &Other)=default
 
 MaybeAlign (MaybeAlign &&Other)=default
 
MaybeAlignoperator= (MaybeAlign &&Other)=default
 
 MaybeAlign (uint64_t Value)
 
Align valueOrOne () const
 For convenience, returns a valid alignment or 1 if undefined. More...
 
- Public Member Functions inherited from llvm::Optional< Align >
constexpr Optional ()
 
constexpr Optional (NoneType)
 
 Optional (const Align &y)
 
 Optional (const Optional &O)=default
 
 Optional (Align &&y)
 
 Optional (Optional &&O)=default
 
Optionaloperator= (Align &&y)
 
Optionaloperator= (Optional &&O)=default
 
Optionaloperator= (const Align &y)
 
Optionaloperator= (const Optional &O)=default
 
void emplace (ArgTypes &&... Args)
 Create a new object by constructing it in place with the given arguments. More...
 
void reset ()
 
const AligngetPointer () const
 
AligngetPointer ()
 
const AligngetValue () const LLVM_LVALUE_FUNCTION
 
AligngetValue () LLVM_LVALUE_FUNCTION
 
 operator bool () const
 
bool hasValue () const
 
const Alignoperator-> () const
 
Alignoperator-> ()
 
const Alignoperator* () const LLVM_LVALUE_FUNCTION
 
Alignoperator* () LLVM_LVALUE_FUNCTION
 
constexpr Align getValueOr (U &&value) const LLVM_LVALUE_FUNCTION
 

Additional Inherited Members

- Public Types inherited from llvm::Optional< Align >
using value_type = Align
 
- Static Public Member Functions inherited from llvm::Optional< Align >
static Optional create (const Align *y)
 

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/4]

llvm::MaybeAlign::MaybeAlign ( )
default

Default is undefined.

◆ MaybeAlign() [2/4]

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/4]

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

◆ MaybeAlign() [4/4]

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

Definition at line 134 of file Alignment.h.

References assert(), 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

For convenience, returns a valid alignment or 1 if undefined.

Definition at line 142 of file Alignment.h.

References llvm::Align::Align().


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