llvm::getAllocAlignment

Gets the alignment argument for an aligned_alloc-like function.

Synopsis

Declared in <llvm/Analysis/MemoryBuiltins.h>

Value*
getAllocAlignment(
    CallBase const* V,
    TargetLibraryInfo const* TLI);

Description

Uses either built-in knowledge based on fuction names/signatures or allocalign attributes. Note: the Value returned may not indicate a valid alignment, per the definition of the allocalign attribute.

Return Value

The alignment argument, or nullptr if none is found.

Parameters

NameDescription
VCall that may be an aligned allocation function.
TLITarget library info used to identify allocation functions.