class EHCleanupScope

Declaration

class EHCleanupScope : public EHScope { /* full declaration omitted */ };

Description

A cleanup scope which generates the cleanup blocks lazily.

Declared at: clang/lib/CodeGen/CGCleanup.h:231

Inherits from: EHScope

Member Variables

private EHScopeStack::stable_iterator EnclosingNormal
The nearest normal cleanup scope enclosing this one.
private EHScopeStack::stable_iterator EnclosingEH
The nearest EH scope enclosing this one.
private llvm::BasicBlock* NormalBlock
The dual entry/exit block along the normal edge. This is lazily created if needed before the cleanup is popped.
private clang::CodeGen::Address ActiveFlag
An optional i1 variable indicating whether this cleanup has been activated yet.
private struct ExtInfo* ExtInfo
private unsigned int FixupDepth
The number of fixups required by enclosing scopes (not including this one). If this is the top cleanup scope, all the fixups from this index onwards belong to this scope.

Inherited from EHScope:

protected

Method Overview

Inherited from EHScope:

Methods

void Destroy()

Declared at: clang/lib/CodeGen/CGCleanup.h:305

EHCleanupScope(
    bool isNormal,
    bool isEH,
    unsigned int cleanupSize,
    unsigned int fixupDepth,
    EHScopeStack::stable_iterator enclosingNormal,
    EHScopeStack::stable_iterator enclosingEH)

Declared at: clang/lib/CodeGen/CGCleanup.h:286

Parameters

bool isNormal
bool isEH
unsigned int cleanupSize
unsigned int fixupDepth
EHScopeStack::stable_iterator enclosingNormal
EHScopeStack::stable_iterator enclosingEH

void addBranchAfter(llvm::ConstantInt* Index,
                    llvm::BasicBlock* Block)

Description

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.

Declared at: clang/lib/CodeGen/CGCleanup.h:372

Parameters

llvm::ConstantInt* Index
llvm::BasicBlock* Block

bool addBranchThrough(llvm::BasicBlock* Block)

Description

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.

Declared at: clang/lib/CodeGen/CGCleanup.h:409

Parameters

llvm::BasicBlock* Block

Returns

true if the branch-through was new to this scope

static bool classof(
    const clang::CodeGen::EHScope* Scope)

Declared at: clang/lib/CodeGen/CGCleanup.h:419

Parameters

const clang::CodeGen::EHScope* Scope

clang::CodeGen::Address getActiveFlag() const

Declared at: clang/lib/CodeGen/CGCleanup.h:324

size_t getAllocatedSize() const

Declared at: clang/lib/CodeGen/CGCleanup.h:282

llvm::BasicBlock* getBranchAfterBlock(
    unsigned int I) const

Declared at: clang/lib/CodeGen/CGCleanup.h:384

Parameters

unsigned int I

llvm::ConstantInt* getBranchAfterIndex(
    unsigned int I) const

Declared at: clang/lib/CodeGen/CGCleanup.h:389

Parameters

unsigned int I

EHScopeStack::Cleanup* getCleanup()

Declared at: clang/lib/CodeGen/CGCleanup.h:354

void* getCleanupBuffer()

Declared at: clang/lib/CodeGen/CGCleanup.h:352

size_t getCleanupSize() const

Declared at: clang/lib/CodeGen/CGCleanup.h:351

EHScopeStack::stable_iterator
getEnclosingNormalCleanup() const

Declared at: clang/lib/CodeGen/CGCleanup.h:347

const struct ExtInfo& getExtInfo() const

Declared at: clang/lib/CodeGen/CGCleanup.h:270

struct ExtInfo& getExtInfo()

Declared at: clang/lib/CodeGen/CGCleanup.h:265

unsigned int getFixupDepth() const

Declared at: clang/lib/CodeGen/CGCleanup.h:346

llvm::BasicBlock* getNormalBlock() const

Declared at: clang/lib/CodeGen/CGCleanup.h:312

unsigned int getNumBranchAfters() const

Description

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

Declared at: clang/lib/CodeGen/CGCleanup.h:380

static size_t getSizeForCleanupSize(size_t Size)

Description

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

Declared at: clang/lib/CodeGen/CGCleanup.h:278

Parameters

size_t Size

bool hasActiveFlag() const

Declared at: clang/lib/CodeGen/CGCleanup.h:323

bool hasBranchThroughs() const

Description

Determines if this cleanup scope has any branch throughs.

Declared at: clang/lib/CodeGen/CGCleanup.h:414

bool hasBranches() const

Description

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

Declared at: clang/lib/CodeGen/CGCleanup.h:359

bool isActive() const

Declared at: clang/lib/CodeGen/CGCleanup.h:317

bool isEHCleanup() const

Declared at: clang/lib/CodeGen/CGCleanup.h:315

bool isLifetimeMarker() const

Declared at: clang/lib/CodeGen/CGCleanup.h:320

bool isNormalCleanup() const

Declared at: clang/lib/CodeGen/CGCleanup.h:311

void setActive(bool A)

Declared at: clang/lib/CodeGen/CGCleanup.h:318

Parameters

bool A

void setActiveFlag(clang::CodeGen::Address Var)

Declared at: clang/lib/CodeGen/CGCleanup.h:327

Parameters

clang::CodeGen::Address Var

void setLifetimeMarker()

Declared at: clang/lib/CodeGen/CGCleanup.h:321

void setNormalBlock(llvm::BasicBlock* BB)

Declared at: clang/lib/CodeGen/CGCleanup.h:313

Parameters

llvm::BasicBlock* BB

void setTestFlagInEHCleanup()

Declared at: clang/lib/CodeGen/CGCleanup.h:339

void setTestFlagInNormalCleanup()

Declared at: clang/lib/CodeGen/CGCleanup.h:332

bool shouldTestFlagInEHCleanup() const

Declared at: clang/lib/CodeGen/CGCleanup.h:342

bool shouldTestFlagInNormalCleanup() const

Declared at: clang/lib/CodeGen/CGCleanup.h:335

~EHCleanupScope()

Declared at: clang/lib/CodeGen/CGCleanup.h:309