LLVM 20.0.0git
Classes | Public Member Functions | List of all members
llvm::safestack::StackLayout Class Reference

Compute the layout of an unsafe stack frame. More...

#include "CodeGen/SafeStackLayout.h"

Public Member Functions

 StackLayout (Align StackAlignment)
 
void addObject (const Value *V, unsigned Size, Align Alignment, const StackLifetime::LiveRange &Range)
 Add an object to the stack frame.
 
void computeLayout ()
 Run the layout computation for all previously added objects.
 
unsigned getObjectOffset (const Value *V)
 Returns the offset to the object start in the stack frame.
 
Align getObjectAlignment (const Value *V)
 Returns the alignment of the object.
 
unsigned getFrameSize ()
 Returns the size of the entire frame.
 
Align getFrameAlignment ()
 Returns the alignment of the frame.
 
void print (raw_ostream &OS)
 

Detailed Description

Compute the layout of an unsafe stack frame.

Definition at line 25 of file SafeStackLayout.h.

Constructor & Destructor Documentation

◆ StackLayout()

llvm::safestack::StackLayout::StackLayout ( Align  StackAlignment)
inline

Definition at line 56 of file SafeStackLayout.h.

Member Function Documentation

◆ addObject()

void StackLayout::addObject ( const Value V,
unsigned  Size,
Align  Alignment,
const StackLifetime::LiveRange Range 
)

Add an object to the stack frame.

Value pointer is opaque and used as a handle to retrieve the object's offset in the frame later.

Definition at line 39 of file SafeStackLayout.cpp.

References llvm::SmallVectorTemplateBase< T, bool >::push_back(), Range, and Size.

◆ computeLayout()

void StackLayout::computeLayout ( )

Run the layout computation for all previously added objects.

Definition at line 135 of file SafeStackLayout.cpp.

References llvm::dbgs(), llvm::drop_begin(), LLVM_DEBUG, print(), llvm::SmallVectorBase< Size_T >::size(), and llvm::stable_sort().

◆ getFrameAlignment()

Align llvm::safestack::StackLayout::getFrameAlignment ( )
inline

Returns the alignment of the frame.

Definition at line 76 of file SafeStackLayout.h.

◆ getFrameSize()

unsigned llvm::safestack::StackLayout::getFrameSize ( )
inline

Returns the size of the entire frame.

Definition at line 73 of file SafeStackLayout.h.

References llvm::SmallVectorTemplateCommon< T, typename >::back(), and llvm::SmallVectorBase< Size_T >::empty().

◆ getObjectAlignment()

Align llvm::safestack::StackLayout::getObjectAlignment ( const Value V)
inline

Returns the alignment of the object.

Definition at line 70 of file SafeStackLayout.h.

◆ getObjectOffset()

unsigned llvm::safestack::StackLayout::getObjectOffset ( const Value V)
inline

Returns the offset to the object start in the stack frame.

Definition at line 67 of file SafeStackLayout.h.

◆ print()

LLVM_DUMP_METHOD void StackLayout::print ( raw_ostream OS)

Definition at line 27 of file SafeStackLayout.cpp.

References IT, OS, and llvm::SmallVectorBase< Size_T >::size().

Referenced by computeLayout().


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