LLVM 22.0.0git
Public Member Functions | Friends | List of all members
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 626 of file DataLayout.h.

Member Function Documentation

◆ getAlignment()

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

Definition at line 639 of file DataLayout.h.

◆ getElementContainingOffset()

unsigned StructLayout::getElementContainingOffset ( uint64_t  FixedOffset) const

◆ getElementOffset()

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

◆ getElementOffsetInBits()

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

Definition at line 662 of file DataLayout.h.

References getElementOffset(), and Idx.

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()

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

◆ 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 643 of file DataLayout.h.

Friends And Related Function Documentation

◆ DataLayout

friend class DataLayout
friend

Definition at line 667 of file DataLayout.h.


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