LLVM  10.0.0svn
Classes | Namespaces | Macros | Functions
Alignment.h File Reference
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/MathExtras.h"
#include <cassert>
#include <limits>
Include dependency graph for Alignment.h:
This graph shows which files directly or indirectly include this file:

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

 llvm
 This class represents lattice values for constants.
 

Macros

#define ALIGN_CHECK_ISPOSITIVE(decl)   assert(decl > 0 && (#decl " should be defined"))
 
#define ALIGN_CHECK_ISSET(decl)   assert(decl.hasValue() && (#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. More...
 
bool llvm::isAligned (Align Lhs, uint64_t SizeInBytes)
 Checks that SizeInBytes is a multiple of the alignment. More...
 
bool llvm::isAligned (MaybeAlign Lhs, uint64_t SizeInBytes)
 Checks that SizeInBytes is a multiple of the alignment. More...
 
uint64_t llvm::alignTo (uint64_t Size, Align A)
 Returns a multiple of A needed to store Size bytes. More...
 
uint64_t llvm::alignTo (uint64_t Size, MaybeAlign A)
 Returns a multiple of A needed to store Size bytes. More...
 
uint64_t llvm::offsetToAlignment (uint64_t Value, llvm::Align Align)
 Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align. More...
 
unsigned llvm::Log2 (Align A)
 Returns the log2 of the alignment. More...
 
unsigned llvm::Log2 (MaybeAlign A)
 Returns the log2 of the alignment. More...
 
Align llvm::commonAlignment (Align A, Align B)
 Returns the alignment that satisfies both alignments. More...
 
Align llvm::commonAlignment (Align A, uint64_t Offset)
 Returns the alignment that satisfies both alignments. More...
 
MaybeAlign llvm::commonAlignment (MaybeAlign A, MaybeAlign B)
 Returns the alignment that satisfies both alignments. More...
 
MaybeAlign llvm::commonAlignment (MaybeAlign A, uint64_t Offset)
 Returns the alignment that satisfies both alignments. More...
 
unsigned llvm::encode (MaybeAlign A)
 Returns a representation of the alignment that encodes undefined as 0. More...
 
MaybeAlign llvm::decodeMaybeAlign (unsigned Value)
 Dual operation of the encode function above. More...
 
unsigned llvm::encode (Align A)
 Returns a representation of the alignment, the encoded value is positive by definition. More...
 
bool llvm::operator== (Align Lhs, uint64_t Rhs)
 Comparisons between Align and scalars. Rhs must be positive. More...
 
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== (MaybeAlign Lhs, uint64_t Rhs)
 Comparisons between MaybeAlign and scalars. More...
 
bool llvm::operator!= (MaybeAlign Lhs, uint64_t Rhs)
 
bool llvm::operator<= (MaybeAlign Lhs, uint64_t Rhs)
 
bool llvm::operator>= (MaybeAlign Lhs, uint64_t Rhs)
 
bool llvm::operator< (MaybeAlign Lhs, uint64_t Rhs)
 
bool llvm::operator> (MaybeAlign Lhs, uint64_t Rhs)
 
bool llvm::operator== (Align Lhs, Align Rhs)
 Comparisons operators between Align. More...
 
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)
 Comparisons operators between Align and MaybeAlign. More...
 
bool llvm::operator!= (Align Lhs, MaybeAlign Rhs)
 
bool llvm::operator<= (Align Lhs, MaybeAlign Rhs)
 
bool llvm::operator>= (Align Lhs, MaybeAlign Rhs)
 
bool llvm::operator< (Align Lhs, MaybeAlign Rhs)
 
bool llvm::operator> (Align Lhs, MaybeAlign Rhs)
 
bool llvm::operator== (MaybeAlign Lhs, Align Rhs)
 Comparisons operators between MaybeAlign and Align. More...
 
bool llvm::operator!= (MaybeAlign Lhs, Align Rhs)
 
bool llvm::operator<= (MaybeAlign Lhs, Align Rhs)
 
bool llvm::operator>= (MaybeAlign Lhs, Align Rhs)
 
bool llvm::operator< (MaybeAlign Lhs, Align Rhs)
 
bool llvm::operator> (MaybeAlign Lhs, Align Rhs)
 
Align llvm::operator/ (Align Lhs, uint64_t Divisor)
 
MaybeAlign llvm::operator/ (MaybeAlign Lhs, uint64_t Divisor)
 

Macro Definition Documentation

◆ ALIGN_CHECK_ISPOSITIVE

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

◆ ALIGN_CHECK_ISSET

#define ALIGN_CHECK_ISSET (   decl)    assert(decl.hasValue() && (#decl " should be defined"))