LLVM  6.0.0svn
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 (unsigned StackAlignment)
 
void addObject (const Value *V, unsigned Size, unsigned Alignment, const StackColoring::LiveRange &Range)
 Add an object to the stack frame. More...
 
void computeLayout ()
 Run the layout computation for all previously added objects. More...
 
unsigned getObjectOffset (const Value *V)
 Returns the offset to the object start in the stack frame. More...
 
unsigned getFrameSize ()
 Returns the size of the entire frame. More...
 
unsigned getFrameAlignment ()
 Returns the alignment of the frame. More...
 
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 ( unsigned  StackAlignment)
inline

Member Function Documentation

◆ addObject()

void StackLayout::addObject ( const Value V,
unsigned  Size,
unsigned  Alignment,
const StackColoring::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 42 of file SafeStackLayout.cpp.

References llvm::max(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size.

Referenced by StackLayout().

◆ computeLayout()

void StackLayout::computeLayout ( )

◆ getFrameAlignment()

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

Returns the alignment of the frame.

Definition at line 71 of file SafeStackLayout.h.

References print().

◆ getFrameSize()

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

Returns the size of the entire frame.

Definition at line 68 of file SafeStackLayout.h.

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

◆ getObjectOffset()

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

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

Definition at line 65 of file SafeStackLayout.h.

◆ print()

LLVM_DUMP_METHOD void StackLayout::print ( raw_ostream OS)

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