LLVM 19.0.0git
Classes | Namespaces | Macros | Functions
Alignment.h File Reference
#include "llvm/Support/MathExtras.h"
#include <cassert>
#include <optional>
#include <string>

Go to the source code of this file.

Classes

struct  llvm::Align
 This struct is a compact representation of a valid (non-zero power of two) alignment. More...
 
struct  llvm::MaybeAlign
 This struct is a compact representation of a valid (power of two) or undefined (0) alignment. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define ALIGN_CHECK_ISPOSITIVE(decl)    assert(decl > 0 && (#decl " should be defined"))
 

Functions

Align llvm::assumeAligned (uint64_t Value)
 Treats the value 0 as a 1, so Align is always at least 1.
 
bool llvm::isAligned (Align Lhs, uint64_t SizeInBytes)
 Checks that SizeInBytes is a multiple of the alignment.
 
bool llvm::isAddrAligned (Align Lhs, const void *Addr)
 Checks that Addr is a multiple of the alignment.
 
uint64_t llvm::alignTo (uint64_t Size, Align A)
 Returns a multiple of A needed to store Size bytes.
 
uint64_t llvm::alignTo (uint64_t Size, Align A, uint64_t Skew)
 If non-zero Skew is specified, the return value will be a minimal integer that is greater than or equal to Size and equal to A * N + Skew for some integer N.
 
uintptr_t llvm::alignAddr (const void *Addr, Align Alignment)
 Aligns Addr to Alignment bytes, rounding up.
 
uint64_t llvm::offsetToAlignment (uint64_t Value, Align Alignment)
 Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align.
 
uint64_t llvm::offsetToAlignedAddr (const void *Addr, Align Alignment)
 Returns the necessary adjustment for aligning Addr to Alignment bytes, rounding up.
 
unsigned llvm::Log2 (Align A)
 Returns the log2 of the alignment.
 
Align llvm::commonAlignment (Align A, uint64_t Offset)
 Returns the alignment that satisfies both alignments.
 
unsigned llvm::encode (MaybeAlign A)
 Returns a representation of the alignment that encodes undefined as 0.
 
MaybeAlign llvm::decodeMaybeAlign (unsigned Value)
 Dual operation of the encode function above.
 
unsigned llvm::encode (Align A)
 Returns a representation of the alignment, the encoded value is positive by definition.
 
bool llvm::operator== (Align Lhs, uint64_t Rhs)
 Comparisons between Align and scalars. Rhs must be positive.
 
bool llvm::operator!= (Align Lhs, uint64_t Rhs)
 
bool llvm::operator<= (Align Lhs, uint64_t Rhs)
 
bool llvm::operator>= (Align Lhs, uint64_t Rhs)
 
bool llvm::operator< (Align Lhs, uint64_t Rhs)
 
bool llvm::operator> (Align Lhs, uint64_t Rhs)
 
bool llvm::operator== (Align Lhs, Align Rhs)
 Comparisons operators between Align.
 
bool llvm::operator!= (Align Lhs, Align Rhs)
 
bool llvm::operator<= (Align Lhs, Align Rhs)
 
bool llvm::operator>= (Align Lhs, Align Rhs)
 
bool llvm::operator< (Align Lhs, Align Rhs)
 
bool llvm::operator> (Align Lhs, Align Rhs)
 
bool llvm::operator<= (Align Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator>= (Align Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator< (Align Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator> (Align Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator<= (MaybeAlign Lhs, Align Rhs)=delete
 
bool llvm::operator>= (MaybeAlign Lhs, Align Rhs)=delete
 
bool llvm::operator< (MaybeAlign Lhs, Align Rhs)=delete
 
bool llvm::operator> (MaybeAlign Lhs, Align Rhs)=delete
 
bool llvm::operator<= (MaybeAlign Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator>= (MaybeAlign Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator< (MaybeAlign Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator> (MaybeAlign Lhs, MaybeAlign Rhs)=delete
 
bool llvm::operator== (MaybeAlign Lhs, Align Rhs)
 
bool llvm::operator!= (MaybeAlign Lhs, Align Rhs)
 
bool llvm::operator== (Align Lhs, MaybeAlign Rhs)
 
bool llvm::operator!= (Align Lhs, MaybeAlign Rhs)
 
bool llvm::operator== (MaybeAlign Lhs, MaybeAlign Rhs)
 
bool llvm::operator!= (MaybeAlign Lhs, MaybeAlign Rhs)
 
bool llvm::operator== (MaybeAlign Lhs, std::nullopt_t)
 
bool llvm::operator!= (MaybeAlign Lhs, std::nullopt_t)
 
bool llvm::operator== (std::nullopt_t, MaybeAlign Rhs)
 
bool llvm::operator!= (std::nullopt_t, MaybeAlign Rhs)
 
std::string llvm::DebugStr (const Align &A)
 
std::string llvm::DebugStr (const MaybeAlign &MA)
 

Macro Definition Documentation

◆ ALIGN_CHECK_ISPOSITIVE

#define ALIGN_CHECK_ISPOSITIVE (   decl)     assert(decl > 0 && (#decl " should be defined"))

Definition at line 33 of file Alignment.h.