LLVM 20.0.0git
|
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 | |
TypeSize | getSizeInBytes () const |
TypeSize | getSizeInBits () const |
Align | getAlignment () const |
bool | hasPadding () const |
Returns whether the struct has padding or not between its fields. | |
unsigned | getElementContainingOffset (uint64_t FixedOffset) const |
Given a valid byte offset into the structure, returns the structure index that contains it. | |
MutableArrayRef< TypeSize > | getMemberOffsets () |
ArrayRef< TypeSize > | getMemberOffsets () const |
TypeSize | getElementOffset (unsigned Idx) const |
TypeSize | getElementOffsetInBits (unsigned Idx) const |
Public Member Functions inherited from llvm::TrailingObjects< StructLayout, TypeSize > | |
const T * | getTrailingObjects () const |
Returns a pointer to the trailing object array of the given type (which must be one of those specified in the class template). | |
T * | getTrailingObjects () |
Returns a pointer to the trailing object array of the given type (which must be one of those specified in the class template). | |
TrailingObjects ()=default | |
TrailingObjects (const TrailingObjects &)=delete | |
TrailingObjects (TrailingObjects &&)=delete | |
TrailingObjects & | operator= (const TrailingObjects &)=delete |
TrailingObjects & | operator= (TrailingObjects &&)=delete |
Friends | |
class | DataLayout |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::TrailingObjects< StructLayout, TypeSize > | |
static constexpr std::enable_if_t< std::is_same_v< Foo< TrailingTys... >, Foo< Tys... > >, size_t > | additionalSizeToAlloc (typename trailing_objects_internal::ExtractSecondType< TrailingTys, size_t >::type... Counts) |
Returns the size of the trailing data, if an object were allocated with the given counts (The counts are in the same order as the template arguments). | |
static constexpr std::enable_if_t< std::is_same_v< Foo< TrailingTys... >, Foo< Tys... > >, size_t > | totalSizeToAlloc (typename trailing_objects_internal::ExtractSecondType< TrailingTys, size_t >::type... Counts) |
Returns the total size of an object if it were allocated with the given trailing object counts. | |
Used to lazily calculate structure layout information for a target machine, based on the DataLayout structure.
Definition at line 572 of file DataLayout.h.
|
inline |
Definition at line 583 of file DataLayout.h.
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 92 of file DataLayout.cpp.
References assert(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::TypeSize::getFixed(), getMemberOffsets(), llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownGT(), llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownLE(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), LHS, llvm::Offset, and RHS.
Referenced by findFuncPointers(), llvm::DataLayout::getGEPIndexForOffset(), llvm::getPointerAtOffset(), getTypePartition(), splitGlobal(), and stripAggregateTypeWrapping().
Definition at line 601 of file DataLayout.h.
References assert(), getMemberOffsets(), and Idx.
Referenced by llvm::GEPOperator::accumulateConstantOffset(), llvm::GEPOperator::collectOffset(), computeKnownBitsFromOperator(), llvm::computeValueLLTs(), llvm::ComputeValueVTs(), emitGlobalConstantStruct(), findFuncPointers(), getElementOffsetInBits(), llvm::TargetTransformInfoImplCRTPBase< T >::getGEPCost(), llvm::DataLayout::getGEPIndexForOffset(), llvm::DataLayout::getIndexedOffsetInType(), llvm::GEPOperator::getMaxPreservedAlignment(), llvm::ScalarEvolution::getOffsetOfExpr(), llvm::getPointerAtOffset(), getTypePartition(), llvm::ExecutionEngine::InitializeMemory(), isGEPKnownNonNull(), llvm::FastISel::selectGetElementPtr(), and splitGlobal().
Definition at line 606 of file DataLayout.h.
References getElementOffset(), and Idx.
Referenced by isDenselyPacked(), and solveDIType().
|
inline |
Definition at line 593 of file DataLayout.h.
Referenced by getElementContainingOffset(), getElementOffset(), and splitGlobal().
Definition at line 597 of file DataLayout.h.
|
inline |
Definition at line 581 of file DataLayout.h.
Referenced by llvm::ScalarEvolution::getOffsetOfExpr(), getTypePartition(), and llvm::DataLayout::getTypeSizeInBits().
|
inline |
Definition at line 579 of file DataLayout.h.
Referenced by emitGlobalConstantStruct(), llvm::DataLayout::getGEPIndexForOffset(), llvm::getPointerAtOffset(), getTypePartition(), and splitGlobal().
|
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 587 of file DataLayout.h.
|
friend |
Definition at line 611 of file DataLayout.h.