LLVM  8.0.0svn
Public Member Functions | Friends | List of all members
llvm::StructLayout Class Reference

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

#include "llvm/IR/DataLayout.h"

Public Member Functions

uint64_t getSizeInBytes () const
 
uint64_t getSizeInBits () const
 
unsigned getAlignment () const
 
bool hasPadding () const
 Returns whether the struct has padding or not between its fields. More...
 
unsigned getElementContainingOffset (uint64_t Offset) const
 Given a valid byte offset into the structure, returns the structure index that contains it. More...
 
uint64_t getElementOffset (unsigned Idx) const
 
uint64_t 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 521 of file DataLayout.h.

Member Function Documentation

◆ getAlignment()

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

◆ getElementContainingOffset()

unsigned StructLayout::getElementContainingOffset ( uint64_t  Offset) const

Given a valid byte offset into the structure, returns the structure index that contains it.

getElementContainingOffset - Given a valid offset into the structure, return the structure index that contains it.

Definition at line 84 of file DataLayout.cpp.

References assert(), SI, and llvm::upper_bound().

Referenced by llvm::ConstantFoldLoadFromConstPtr(), llvm::ConstantFoldLoadThroughBitcast(), foldOperationIntoPhiValue(), getNaturalGEPRecursively(), getTypePartition(), llvm::WholeProgramDevirtPass::run(), and stripAggregateTypeWrapping().

◆ getElementOffset()

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

◆ getElementOffsetInBits()

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

Definition at line 548 of file DataLayout.h.

Referenced by SRAGlobal().

◆ getSizeInBits()

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

Definition at line 531 of file DataLayout.h.

◆ getSizeInBytes()

uint64_t 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 537 of file DataLayout.h.

Friends And Related Function Documentation

◆ DataLayout

friend class DataLayout
friend

Definition at line 553 of file DataLayout.h.


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