ΒΆunsigned int ComputeLinearIndex(
    llvm::Type* Ty,
    const unsigned int* Indices,
    const unsigned int* IndicesEnd,
    unsigned int CurIndex = 0)

Description

Compute the linearized index of a member in a nested aggregate/struct/array. Given an LLVM IR aggregate type and a sequence of insertvalue or extractvalue indices that identify a member, return the linearized index of the start of the member, i.e the number of element in memory before the sought one. This is disconnected from the number of bytes.

Declared at: llvm/include/llvm/CodeGen/Analysis.h:54

Parameters

llvm::Type* Ty
is the type indexed by \p Indices.
const unsigned int* Indices
is an optional pointer in the indices list to the current index.
const unsigned int* IndicesEnd
is the end of the indices list.
unsigned int CurIndex = 0
is the current index in the recursion.

Returns

\p CurIndex plus the linear index in \p Ty the indices list.