clang  19.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
clang::CodeGen::EHCleanupScope Class Reference

A cleanup scope which generates the cleanup blocks lazily. More...

#include "/home/runner/work/llvm/llvm/repo/clang/lib/CodeGen/CGCleanup.h"

Inheritance diagram for clang::CodeGen::EHCleanupScope:
Inheritance graph
[legend]

Public Member Functions

size_t getAllocatedSize () const
 
 EHCleanupScope (bool isNormal, bool isEH, unsigned cleanupSize, unsigned fixupDepth, EHScopeStack::stable_iterator enclosingNormal, EHScopeStack::stable_iterator enclosingEH)
 
void Destroy ()
 
void AddAuxAllocas (llvm::SmallVector< llvm::AllocaInst * > Allocas)
 
void MarkEmitted ()
 
 ~EHCleanupScope ()=delete
 
bool isNormalCleanup () const
 
llvm::BasicBlock * getNormalBlock () const
 
void setNormalBlock (llvm::BasicBlock *BB)
 
bool isEHCleanup () const
 
bool isActive () const
 
void setActive (bool A)
 
bool isLifetimeMarker () const
 
void setLifetimeMarker ()
 
bool hasActiveFlag () const
 
Address getActiveFlag () const
 
void setActiveFlag (RawAddress Var)
 
void setTestFlagInNormalCleanup ()
 
bool shouldTestFlagInNormalCleanup () const
 
void setTestFlagInEHCleanup ()
 
bool shouldTestFlagInEHCleanup () const
 
unsigned getFixupDepth () const
 
EHScopeStack::stable_iterator getEnclosingNormalCleanup () const
 
size_t getCleanupSize () const
 
void * getCleanupBuffer ()
 
EHScopeStack::CleanupgetCleanup ()
 
bool hasBranches () const
 True if this cleanup scope has any branch-afters or branch-throughs. More...
 
void addBranchAfter (llvm::ConstantInt *Index, llvm::BasicBlock *Block)
 Add a branch-after to this cleanup scope. More...
 
unsigned getNumBranchAfters () const
 Return the number of unique branch-afters on this scope. More...
 
llvm::BasicBlock * getBranchAfterBlock (unsigned I) const
 
llvm::ConstantInt * getBranchAfterIndex (unsigned I) const
 
bool addBranchThrough (llvm::BasicBlock *Block)
 Add a branch-through to this cleanup scope. More...
 
bool hasBranchThroughs () const
 Determines if this cleanup scope has any branch throughs. More...
 
- Public Member Functions inherited from clang::CodeGen::EHScope
 EHScope (Kind kind, EHScopeStack::stable_iterator enclosingEHScope)
 
Kind getKind () const
 
llvm::BasicBlock * getCachedLandingPad () const
 
void setCachedLandingPad (llvm::BasicBlock *block)
 
llvm::BasicBlock * getCachedEHDispatchBlock () const
 
void setCachedEHDispatchBlock (llvm::BasicBlock *block)
 
bool hasEHBranches () const
 
EHScopeStack::stable_iterator getEnclosingEHScope () const
 

Static Public Member Functions

static size_t getSizeForCleanupSize (size_t Size)
 Gets the size required for a lazy cleanup scope with the given cleanup-data requirements. More...
 
static bool classof (const EHScope *Scope)
 

Additional Inherited Members

- Public Types inherited from clang::CodeGen::EHScope
enum  Kind { Cleanup , Catch , Terminate , Filter }
 
- Protected Attributes inherited from clang::CodeGen::EHScope
union {
   CommonBitFields   CommonBits
 
   CatchBitFields   CatchBits
 
   CleanupBitFields   CleanupBits
 
   FilterBitFields   FilterBits
 
}; 
 

Detailed Description

A cleanup scope which generates the cleanup blocks lazily.

Definition at line 243 of file CGCleanup.h.

Constructor & Destructor Documentation

◆ EHCleanupScope()

clang::CodeGen::EHCleanupScope::EHCleanupScope ( bool  isNormal,
bool  isEH,
unsigned  cleanupSize,
unsigned  fixupDepth,
EHScopeStack::stable_iterator  enclosingNormal,
EHScopeStack::stable_iterator  enclosingEH 
)
inline

Definition at line 343 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

Referenced by getAllocatedSize(), and getSizeForCleanupSize().

◆ ~EHCleanupScope()

clang::CodeGen::EHCleanupScope::~EHCleanupScope ( )
delete

Member Function Documentation

◆ AddAuxAllocas()

void clang::CodeGen::EHCleanupScope::AddAuxAllocas ( llvm::SmallVector< llvm::AllocaInst * >  Allocas)
inline

Definition at line 367 of file CGCleanup.h.

◆ addBranchAfter()

void clang::CodeGen::EHCleanupScope::addBranchAfter ( llvm::ConstantInt *  Index,
llvm::BasicBlock *  Block 
)
inline

Add a branch-after to this cleanup scope.

A branch-after is a branch from a point protected by this (normal) cleanup to a point in the normal cleanup scope immediately containing it. For example, for (;;) { A a; break; } contains a branch-after.

Branch-afters each have their own destination out of the cleanup, guaranteed distinct from anything else threaded through it. Therefore branch-afters usually force a switch after the cleanup.

Definition at line 436 of file CGCleanup.h.

◆ addBranchThrough()

bool clang::CodeGen::EHCleanupScope::addBranchThrough ( llvm::BasicBlock *  Block)
inline

Add a branch-through to this cleanup scope.

A branch-through is a branch from a scope protected by this (normal) cleanup to an enclosing scope other than the immediately-enclosing normal cleanup scope.

In the following example, the branch through B's scope is a branch-through, while the branch through A's scope is a branch-after: for (;;) { A a; B b; break; }

All branch-throughs have a common destination out of the cleanup, one possibly shared with the fall-through. Therefore branch-throughs usually don't force a switch after the cleanup.

Returns
true if the branch-through was new to this scope

Definition at line 473 of file CGCleanup.h.

References Block.

◆ classof()

static bool clang::CodeGen::EHCleanupScope::classof ( const EHScope Scope)
inlinestatic

Definition at line 483 of file CGCleanup.h.

References clang::CodeGen::EHScope::Cleanup.

◆ Destroy()

void clang::CodeGen::EHCleanupScope::Destroy ( )
inline

Definition at line 362 of file CGCleanup.h.

◆ getActiveFlag()

Address clang::CodeGen::EHCleanupScope::getActiveFlag ( ) const
inline

Definition at line 388 of file CGCleanup.h.

◆ getAllocatedSize()

size_t clang::CodeGen::EHCleanupScope::getAllocatedSize ( ) const
inline

Definition at line 339 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits, and EHCleanupScope().

◆ getBranchAfterBlock()

llvm::BasicBlock* clang::CodeGen::EHCleanupScope::getBranchAfterBlock ( unsigned  I) const
inline

Definition at line 448 of file CGCleanup.h.

References getNumBranchAfters().

◆ getBranchAfterIndex()

llvm::ConstantInt* clang::CodeGen::EHCleanupScope::getBranchAfterIndex ( unsigned  I) const
inline

Definition at line 453 of file CGCleanup.h.

References getNumBranchAfters().

◆ getCleanup()

EHScopeStack::Cleanup* clang::CodeGen::EHCleanupScope::getCleanup ( )
inline

Definition at line 418 of file CGCleanup.h.

References getCleanupBuffer().

Referenced by clang::CodeGen::CodeGenFunction::EmitCall().

◆ getCleanupBuffer()

void* clang::CodeGen::EHCleanupScope::getCleanupBuffer ( )
inline

Definition at line 416 of file CGCleanup.h.

Referenced by getCleanup().

◆ getCleanupSize()

size_t clang::CodeGen::EHCleanupScope::getCleanupSize ( ) const
inline

Definition at line 415 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ getEnclosingNormalCleanup()

EHScopeStack::stable_iterator clang::CodeGen::EHCleanupScope::getEnclosingNormalCleanup ( ) const
inline

Definition at line 411 of file CGCleanup.h.

◆ getFixupDepth()

unsigned clang::CodeGen::EHCleanupScope::getFixupDepth ( ) const
inline

Definition at line 410 of file CGCleanup.h.

◆ getNormalBlock()

llvm::BasicBlock* clang::CodeGen::EHCleanupScope::getNormalBlock ( ) const
inline

Definition at line 376 of file CGCleanup.h.

Referenced by destroyOptimisticNormalEntry().

◆ getNumBranchAfters()

unsigned clang::CodeGen::EHCleanupScope::getNumBranchAfters ( ) const
inline

Return the number of unique branch-afters on this scope.

Definition at line 444 of file CGCleanup.h.

Referenced by getBranchAfterBlock(), and getBranchAfterIndex().

◆ getSizeForCleanupSize()

static size_t clang::CodeGen::EHCleanupScope::getSizeForCleanupSize ( size_t  Size)
inlinestatic

Gets the size required for a lazy cleanup scope with the given cleanup-data requirements.

Definition at line 335 of file CGCleanup.h.

References EHCleanupScope().

◆ hasActiveFlag()

bool clang::CodeGen::EHCleanupScope::hasActiveFlag ( ) const
inline

Definition at line 387 of file CGCleanup.h.

References clang::CodeGen::Address::isValid().

◆ hasBranches()

bool clang::CodeGen::EHCleanupScope::hasBranches ( ) const
inline

True if this cleanup scope has any branch-afters or branch-throughs.

Definition at line 423 of file CGCleanup.h.

◆ hasBranchThroughs()

bool clang::CodeGen::EHCleanupScope::hasBranchThroughs ( ) const
inline

Determines if this cleanup scope has any branch throughs.

Definition at line 478 of file CGCleanup.h.

◆ isActive()

bool clang::CodeGen::EHCleanupScope::isActive ( ) const
inline

Definition at line 381 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ isEHCleanup()

bool clang::CodeGen::EHCleanupScope::isEHCleanup ( ) const
inline

Definition at line 379 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ isLifetimeMarker()

bool clang::CodeGen::EHCleanupScope::isLifetimeMarker ( ) const
inline

Definition at line 384 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ isNormalCleanup()

bool clang::CodeGen::EHCleanupScope::isNormalCleanup ( ) const
inline

Definition at line 375 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ MarkEmitted()

void clang::CodeGen::EHCleanupScope::MarkEmitted ( )
inline

Definition at line 371 of file CGCleanup.h.

◆ setActive()

void clang::CodeGen::EHCleanupScope::setActive ( bool  A)
inline

Definition at line 382 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ setActiveFlag()

void clang::CodeGen::EHCleanupScope::setActiveFlag ( RawAddress  Var)
inline

◆ setLifetimeMarker()

void clang::CodeGen::EHCleanupScope::setLifetimeMarker ( )
inline

Definition at line 385 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ setNormalBlock()

void clang::CodeGen::EHCleanupScope::setNormalBlock ( llvm::BasicBlock *  BB)
inline

Definition at line 377 of file CGCleanup.h.

◆ setTestFlagInEHCleanup()

void clang::CodeGen::EHCleanupScope::setTestFlagInEHCleanup ( )
inline

Definition at line 403 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ setTestFlagInNormalCleanup()

void clang::CodeGen::EHCleanupScope::setTestFlagInNormalCleanup ( )
inline

Definition at line 396 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ shouldTestFlagInEHCleanup()

bool clang::CodeGen::EHCleanupScope::shouldTestFlagInEHCleanup ( ) const
inline

Definition at line 406 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.

◆ shouldTestFlagInNormalCleanup()

bool clang::CodeGen::EHCleanupScope::shouldTestFlagInNormalCleanup ( ) const
inline

Definition at line 399 of file CGCleanup.h.

References clang::CodeGen::EHScope::CleanupBits.


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