LLVM 22.0.0git
llvm::StructLayout Class Referencefinal

Used to lazily calculate structure layout information for a target machine, based on the DataLayout structure. More...

#include "llvm/IR/DataLayout.h"

Inheritance diagram for llvm::StructLayout:
[legend]

Public Member Functions

TypeSize getSizeInBytes () const
TypeSize getSizeInBits () const
Align getAlignment () const
bool hasPadding () const
 Returns whether the struct has padding or not between its fields.
LLVM_ABI unsigned getElementContainingOffset (uint64_t FixedOffset) const
 Given a valid byte offset into the structure, returns the structure index that contains it.
MutableArrayRef< TypeSizegetMemberOffsets ()
ArrayRef< TypeSizegetMemberOffsets () const
TypeSize getElementOffset (unsigned Idx) const
TypeSize getElementOffsetInBits (unsigned Idx) const

Friends

class DataLayout

Detailed Description

Used to lazily calculate structure layout information for a target machine, based on the DataLayout structure.

Definition at line 712 of file DataLayout.h.

Member Function Documentation

◆ getAlignment()

Align llvm::StructLayout::getAlignment ( ) const
inline

Definition at line 725 of file DataLayout.h.

Referenced by llvm::DataLayout::getTypeAllocSize().

◆ getElementContainingOffset()

unsigned StructLayout::getElementContainingOffset ( uint64_t FixedOffset) const

◆ getElementOffset()

◆ getElementOffsetInBits()

TypeSize llvm::StructLayout::getElementOffsetInBits ( unsigned Idx) const
inline

Definition at line 748 of file DataLayout.h.

References getElementOffset().

Referenced by isDenselyPacked(), and solveDIType().

◆ getMemberOffsets() [1/2]

MutableArrayRef< TypeSize > llvm::StructLayout::getMemberOffsets ( )
inline

◆ getMemberOffsets() [2/2]

ArrayRef< TypeSize > llvm::StructLayout::getMemberOffsets ( ) const
inline

◆ getSizeInBits()

TypeSize llvm::StructLayout::getSizeInBits ( ) const
inline

◆ getSizeInBytes()

◆ hasPadding()

bool llvm::StructLayout::hasPadding ( ) const
inline

Returns whether the struct has padding or not between its fields.

NB: Padding in nested element is not taken into account.

Definition at line 729 of file DataLayout.h.

◆ DataLayout

friend class DataLayout
friend

Definition at line 753 of file DataLayout.h.

References DataLayout, and DL.

Referenced by DataLayout.


The documentation for this class was generated from the following files: