LLVM  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
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

LandingPadInstclone_impl () const override

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 2426 of file Instructions.h.


Member Enumeration Documentation

Enumerator:
Catch 
Filter 

Definition at line 2432 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 210 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 2499 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 2502 of file Instructions.h.

LandingPadInst * LandingPadInst::clone_impl ( ) const [override, protected, virtual]

Implements llvm::Instruction.

Definition at line 3601 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 181 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 187 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 2477 of file Instructions.h.

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

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

Definition at line 2492 of file Instructions.h.

Referenced by llvm::AddLandingPadInfo(), HandleInlinedInvoke(), isCatchAllLandingPad(), 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 2482 of file Instructions.h.

Referenced by llvm::AddLandingPadInfo(), isCatchAllLandingPad(), 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 2464 of file Instructions.h.

Referenced by llvm::AddLandingPadInfo(), HandleInlinedInvoke(), 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 2487 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 2496 of file Instructions.h.

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

setCleanup - Indicate that this landingpad instruction is a cleanup.

Definition at line 2467 of file Instructions.h.

Referenced by createStubLandingPad(), and llvm::InstCombiner::visitLandingPadInst().


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