LLVM  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
llvm::LandingPadInst Class Reference

LandingPadInst - The landingpad instruction holds all of the information necessary to generate correct exception handling. More...

#include <Instructions.h>

Inheritance diagram for llvm::LandingPadInst:
Inheritance graph
[legend]
Collaboration diagram for llvm::LandingPadInst:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ClauseType { Catch, Filter }

Public Member Functions

 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Provide fast operand accessors.
bool isCleanup () const
 isCleanup - Return 'true' if this landingpad instruction is a cleanup.
void setCleanup (bool V)
 setCleanup - Indicate that this landingpad instruction is a cleanup.
void addClause (Constant *ClauseVal)
 Add a catch or filter clause to the landing pad.
ConstantgetClause (unsigned Idx) const
 Get the value of the clause at index Idx.
bool isCatch (unsigned Idx) const
 isCatch - Return 'true' if the clause and index Idx is a catch clause.
bool isFilter (unsigned Idx) const
 isFilter - Return 'true' if the clause and index Idx is a filter clause.
unsigned getNumClauses () const
 getNumClauses - Get the number of clauses for this landing pad.
void reserveClauses (unsigned Size)
 reserveClauses - Grow the size of the operand list to accommodate the new number of clauses.

Static Public Member Functions

static LandingPadInstCreate (Type *RetTy, unsigned NumReservedClauses, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
 Constructors - NumReservedClauses is a hint for the number of incoming clauses that this landingpad will have (use 0 if you really have no idea).
static LandingPadInstCreate (Type *RetTy, unsigned NumReservedClauses, const Twine &NameStr, BasicBlock *InsertAtEnd)
static bool classof (const Instruction *I)
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast:

Protected Member Functions

LandingPadInstcloneImpl () const
 Create a copy of this instruction.

Friends

class Instruction

Detailed Description

LandingPadInst - The landingpad instruction holds all of the information necessary to generate correct exception handling.

The landingpad instruction cannot be moved from the top of a landing pad block, which itself is accessible only from the 'unwind' edge of an invoke. This uses the SubclassData field in Value to store whether or not the landingpad is a cleanup.

Definition at line 2644 of file Instructions.h.


Member Enumeration Documentation

Enumerator:
Catch 
Filter 

Definition at line 2651 of file Instructions.h.


Member Function Documentation

void LandingPadInst::addClause ( Constant ClauseVal)

Add a catch or filter clause to the landing pad.

Definition at line 215 of file Instructions.cpp.

References llvm::User::getNumOperands(), llvm::User::getOperandList(), and llvm::User::setNumHungOffUseOperands().

Referenced by llvm::InstCombiner::visitLandingPadInst().

static bool llvm::LandingPadInst::classof ( const Instruction I) [inline, static]

Definition at line 2722 of file Instructions.h.

References llvm::Instruction::getOpcode(), and llvm::LandingPad.

static bool llvm::LandingPadInst::classof ( const Value V) [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:

Reimplemented from llvm::Instruction.

Definition at line 2725 of file Instructions.h.

LandingPadInst * LandingPadInst::cloneImpl ( ) const [protected]

Create a copy of this instruction.

Reimplemented from llvm::Instruction.

Definition at line 3932 of file Instructions.cpp.

LandingPadInst * LandingPadInst::Create ( Type RetTy,
unsigned  NumReservedClauses,
const Twine NameStr = "",
Instruction InsertBefore = nullptr 
) [static]

Constructors - NumReservedClauses is a hint for the number of incoming clauses that this landingpad will have (use 0 if you really have no idea).

Definition at line 186 of file Instructions.cpp.

Referenced by llvm::IRBuilder< true, TargetFolder >::CreateLandingPad(), and llvm::InstCombiner::visitLandingPadInst().

LandingPadInst * LandingPadInst::Create ( Type RetTy,
unsigned  NumReservedClauses,
const Twine NameStr,
BasicBlock InsertAtEnd 
) [static]

Definition at line 192 of file Instructions.cpp.

Provide fast operand accessors.

Get the value of the clause at index Idx.

Use isCatch/isFilter to determine what type of clause this is.

Definition at line 2700 of file Instructions.h.

Referenced by llvm::AddLandingPadInfo(), HandleInlinedLandingPad(), llvm::InstCombiner::visitLandingPadInst(), and WriteInstruction().

getNumClauses - Get the number of clauses for this landing pad.

Definition at line 2715 of file Instructions.h.

Referenced by llvm::AddLandingPadInfo(), HandleInlinedLandingPad(), llvm::InstCombiner::visitLandingPadInst(), and WriteInstruction().

bool llvm::LandingPadInst::isCatch ( unsigned  Idx) const [inline]

isCatch - Return 'true' if the clause and index Idx is a catch clause.

Definition at line 2705 of file Instructions.h.

Referenced by llvm::AddLandingPadInfo(), llvm::InstCombiner::visitLandingPadInst(), and WriteInstruction().

isCleanup - Return 'true' if this landingpad instruction is a cleanup.

I.e., it should be run when unwinding even if its landing pad doesn't catch the exception.

Definition at line 2687 of file Instructions.h.

Referenced by llvm::AddLandingPadInfo(), HandleInlinedLandingPad(), llvm::InstCombiner::visitLandingPadInst(), and WriteInstruction().

bool llvm::LandingPadInst::isFilter ( unsigned  Idx) const [inline]

isFilter - Return 'true' if the clause and index Idx is a filter clause.

Definition at line 2710 of file Instructions.h.

Referenced by llvm::InstCombiner::visitLandingPadInst().

reserveClauses - Grow the size of the operand list to accommodate the new number of clauses.

Definition at line 2719 of file Instructions.h.

void llvm::LandingPadInst::setCleanup ( bool  V) [inline]

setCleanup - Indicate that this landingpad instruction is a cleanup.

Definition at line 2690 of file Instructions.h.

Referenced by llvm::InstCombiner::visitLandingPadInst().


Friends And Related Function Documentation

friend class Instruction [friend]

Definition at line 2669 of file Instructions.h.


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