alignTo overloads

Synopses

Declared in <llvm/Support/Alignment.h>

Returns the next integer (mod 2**nbits) that is greater than or equal to Value and is a multiple of Align. Align must be non‐zero.

template<
    auto Align,
    typename V,
    typename T = common_uint<decltype(Align), V>>
constexpr
T
alignTo(V Value);

Round Size up to a multiple of Align.

constexpr
TypeSize
alignTo(
    TypeSize Size,
    uint64_t Align);

Returns a multiple of A needed to store Size bytes.

constexpr
uint64_t
alignTo(
    uint64_t Size,
    Align A);

Fallback when arguments aren't integral.

constexpr
uint64_t
alignTo(
    uint64_t Value,
    uint64_t Align);

Returns the next integer (mod 2**nbits) that is greater than or equal to Value and is a multiple of Align. Align must be non‐zero.

template<
    typename U,
    typename V,
    typename T = common_uint<U, V>>
constexpr
T
alignTo(
    U Value,
    V Align);

Returns the smallest value at least Size congruent to Skew modulo A.

uint64_t
alignTo(
    uint64_t Size,
    Align A,
    uint64_t Skew);

Align Value up to Align with an optional Skew offset.

template<
    typename U,
    typename V,
    typename W,
    typename T = common_uint<common_uint<U, V>, W>>
constexpr
T
alignTo(
    U Value,
    V Align,
    W Skew);

Return Value

  • Value rounded up to the next multiple of Align.

  • TypeSize with known‐min rounded up to a multiple of Align.

  • Size rounded up to the next multiple of A.

  • The smallest value at least Size congruent to Skew modulo A.

  • The smallest value at least Value equal to Align * N + Skew.

Parameters

Name

Description

Value

Value to align upward.

Size

Quantity whose known‐min size is rounded up.

Align

Non‐zero alignment in the same units as Size.

A

Alignment to round up to.

Skew

Desired residue modulo A.

Created with MrDocs