LLVM  12.0.0git
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
llvm::OptimizedStructLayoutField Struct Reference

A field in a structure. More...

#include "llvm/Support/OptimizedStructLayout.h"

Collaboration diagram for llvm::OptimizedStructLayoutField:
Collaboration graph
[legend]

Public Member Functions

 OptimizedStructLayoutField (const void *Id, uint64_t Size, Align Alignment, uint64_t FixedOffset=FlexibleOffset)
 
bool hasFixedOffset () const
 Return true if this field has been assigned a fixed offset. More...
 
uint64_t getEndOffset () const
 Given that this field has a fixed offset, return the offset of the first byte following it. More...
 

Public Attributes

uint64_t Offset
 The offset of this field in the final layout. More...
 
uint64_t Size
 The required size of this field in bytes. More...
 
const void * Id
 A opaque value which uniquely identifies this field. More...
 
void * Scratch
 Private scratch space for the algorithm. More...
 
Align Alignment
 The required alignment of this field. More...
 

Static Public Attributes

static constexpr uint64_t FlexibleOffset = ~(uint64_t)0
 A special value for Offset indicating that the field can be moved anywhere. More...
 

Detailed Description

A field in a structure.

Definition at line 44 of file OptimizedStructLayout.h.

Constructor & Destructor Documentation

◆ OptimizedStructLayoutField()

llvm::OptimizedStructLayoutField::OptimizedStructLayoutField ( const void *  Id,
uint64_t  Size,
Align  Alignment,
uint64_t  FixedOffset = FlexibleOffset 
)
inline

Definition at line 49 of file OptimizedStructLayout.h.

References assert().

Member Function Documentation

◆ getEndOffset()

uint64_t llvm::OptimizedStructLayoutField::getEndOffset ( ) const
inline

Given that this field has a fixed offset, return the offset of the first byte following it.

Definition at line 82 of file OptimizedStructLayout.h.

References assert(), hasFixedOffset(), llvm::performOptimizedStructLayout(), and Size.

Referenced by checkValidLayout(), and llvm::performOptimizedStructLayout().

◆ hasFixedOffset()

bool llvm::OptimizedStructLayoutField::hasFixedOffset ( ) const
inline

Return true if this field has been assigned a fixed offset.

After layout, this will be true of all the fields.

Definition at line 76 of file OptimizedStructLayout.h.

Referenced by checkValidLayout(), getEndOffset(), and llvm::performOptimizedStructLayout().

Member Data Documentation

◆ Alignment

Align llvm::OptimizedStructLayoutField::Alignment

The required alignment of this field.

Definition at line 72 of file OptimizedStructLayout.h.

Referenced by checkValidLayout(), dump(), and llvm::performOptimizedStructLayout().

◆ FlexibleOffset

constexpr uint64_t llvm::OptimizedStructLayoutField::FlexibleOffset = ~(uint64_t)0
static

A special value for Offset indicating that the field can be moved anywhere.

Definition at line 47 of file OptimizedStructLayout.h.

Referenced by dump().

◆ Id

const void* llvm::OptimizedStructLayoutField::Id

A opaque value which uniquely identifies this field.

Definition at line 65 of file OptimizedStructLayout.h.

◆ Offset

uint64_t llvm::OptimizedStructLayoutField::Offset

The offset of this field in the final layout.

If this is initialized to FlexibleOffset, layout will overwrite it with the assigned offset of the field.

Definition at line 58 of file OptimizedStructLayout.h.

Referenced by checkValidLayout(), dump(), and llvm::performOptimizedStructLayout().

◆ Scratch

void* llvm::OptimizedStructLayoutField::Scratch

Private scratch space for the algorithm.

The implementation must treat this as uninitialized memory on entry.

Definition at line 69 of file OptimizedStructLayout.h.

Referenced by llvm::performOptimizedStructLayout().

◆ Size

uint64_t llvm::OptimizedStructLayoutField::Size

The required size of this field in bytes.

Does not have to be a multiple of Alignment. Must be non-zero.

Definition at line 62 of file OptimizedStructLayout.h.

Referenced by dump(), getEndOffset(), and llvm::performOptimizedStructLayout().


The documentation for this struct was generated from the following file: