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

InvokeInst - Invoke instruction. More...

#include <Instructions.h>

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

List of all members.

Public Member Functions

 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Provide fast operand accessors.
FunctionTypegetFunctionType () const
void mutateFunctionType (FunctionType *FTy)
unsigned getNumArgOperands () const
 getNumArgOperands - Return the number of invoke arguments.
ValuegetArgOperand (unsigned i) const
 getArgOperand/setArgOperand - Return/set the i-th invoke argument.
void setArgOperand (unsigned i, Value *v)
op_iterator arg_begin ()
 Return the iterator pointing to the beginning of the argument list.
op_iterator arg_end ()
 Return the iterator pointing to the end of the argument list.
iterator_range< op_iteratorarg_operands ()
 Iteration adapter for range-for loops.
const_op_iterator arg_begin () const
 Return the iterator pointing to the beginning of the argument list.
const_op_iterator arg_end () const
 Return the iterator pointing to the end of the argument list.
iterator_range< const_op_iteratorarg_operands () const
 Iteration adapter for range-for loops.
const UsegetArgOperandUse (unsigned i) const
 Wrappers for getting the Use of a invoke argument.
UsegetArgOperandUse (unsigned i)
CallingConv::ID getCallingConv () const
 getCallingConv/setCallingConv - Get or set the calling convention of this function call.
void setCallingConv (CallingConv::ID CC)
const AttributeSetgetAttributes () const
 getAttributes - Return the parameter attributes for this invoke.
void setAttributes (const AttributeSet &Attrs)
 setAttributes - Set the parameter attributes for this invoke.
void addAttribute (unsigned i, Attribute::AttrKind attr)
 addAttribute - adds the attribute to the list of attributes.
void removeAttribute (unsigned i, Attribute attr)
 removeAttribute - removes the attribute from the list of attributes.
void addDereferenceableAttr (unsigned i, uint64_t Bytes)
 adds the dereferenceable attribute to the list of attributes.
void addDereferenceableOrNullAttr (unsigned i, uint64_t Bytes)
 adds the dereferenceable_or_null attribute to the list of attributes.
bool hasFnAttr (Attribute::AttrKind A) const
 Determine whether this call has the given attribute.
bool hasFnAttr (StringRef A) const
 Determine whether this call has the given attribute.
bool paramHasAttr (unsigned i, Attribute::AttrKind A) const
 Determine whether the call or the callee has the given attributes.
bool dataOperandHasImpliedAttr (unsigned i, Attribute::AttrKind A) const
 Return true if the data operand at index i has the attribute A.
unsigned getParamAlignment (unsigned i) const
 Extract the alignment for a call or parameter (0=unknown).
uint64_t getDereferenceableBytes (unsigned i) const
 Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
uint64_t getDereferenceableOrNullBytes (unsigned i) const
 Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).
bool doesNotAlias (unsigned n) const
 Determine if the parameter or return value is marked with NoAlias attribute.
bool isNoBuiltin () const
 Return true if the call should not be treated as a call to a builtin.
bool isNoInline () const
 Return true if the call should not be inlined.
void setIsNoInline ()
bool doesNotAccessMemory () const
 Determine if the call does not access memory.
void setDoesNotAccessMemory ()
bool onlyReadsMemory () const
 Determine if the call does not access or only reads memory.
void setOnlyReadsMemory ()
bool onlyAccessesArgMemory () const
 Determine if the call access memmory only using it's pointer arguments.
void setOnlyAccessesArgMemory ()
bool doesNotReturn () const
 Determine if the call cannot return.
void setDoesNotReturn ()
bool doesNotThrow () const
 Determine if the call cannot unwind.
void setDoesNotThrow ()
bool cannotDuplicate () const
 Determine if the invoke cannot be duplicated.
void setCannotDuplicate ()
bool hasStructRetAttr () const
 Determine if the call returns a structure through first pointer argument.
bool hasByValArgument () const
 Determine if any call argument is an aggregate passed by value.
FunctiongetCalledFunction () const
 getCalledFunction - Return the function called, or null if this is an indirect function invocation.
const ValuegetCalledValue () const
 getCalledValue - Get a pointer to the function that is invoked by this instruction
ValuegetCalledValue ()
void setCalledFunction (Value *Fn)
 setCalledFunction - Set the function called.
void setCalledFunction (FunctionType *FTy, Value *Fn)
BasicBlockgetNormalDest () const
BasicBlockgetUnwindDest () const
void setNormalDest (BasicBlock *B)
void setUnwindDest (BasicBlock *B)
LandingPadInstgetLandingPadInst () const
 getLandingPadInst - Get the landingpad instruction from the landing pad block (the unwind destination).
BasicBlockgetSuccessor (unsigned i) const
 Return the specified successor.
void setSuccessor (unsigned idx, BasicBlock *NewSucc)
 Update the specified successor to point at the provided block.
unsigned getNumSuccessors () const
 Return the number of successors that this terminator has.

Static Public Member Functions

static InvokeInstCreate (Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, Instruction *InsertBefore=nullptr)
static InvokeInstCreate (Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static InvokeInstCreate (FunctionType *Ty, Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, Instruction *InsertBefore=nullptr)
static InvokeInstCreate (FunctionType *Ty, Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static InvokeInstCreate (Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, BasicBlock *InsertAtEnd)
static InvokeInstCreate (Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles, const Twine &NameStr, BasicBlock *InsertAtEnd)
static InvokeInstCreate (InvokeInst *II, ArrayRef< OperandBundleDef > Bundles, Instruction *InsertPt=nullptr)
 Create a clone of II with a different set of operand bundles and insert it before InsertPt.
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

InvokeInstcloneImpl () const
 Create a copy of this instruction.

Friends

class OperandBundleUser< InvokeInst, User::op_iterator >
class Instruction

Detailed Description

InvokeInst - Invoke instruction.

The SubclassData field is used to hold the calling convention of the call.

Definition at line 3332 of file Instructions.h.


Member Function Documentation

addAttribute - adds the attribute to the list of attributes.

Definition at line 642 of file Instructions.cpp.

References llvm::AttributeSet::addAttribute(), getAttributes(), llvm::Value::getContext(), and setAttributes().

void InvokeInst::addDereferenceableAttr ( unsigned  i,
uint64_t  Bytes 
)

adds the dereferenceable attribute to the list of attributes.

Definition at line 656 of file Instructions.cpp.

References llvm::AttributeSet::addDereferenceableAttr(), getAttributes(), llvm::Value::getContext(), and setAttributes().

void InvokeInst::addDereferenceableOrNullAttr ( unsigned  i,
uint64_t  Bytes 
)

adds the dereferenceable_or_null attribute to the list of attributes.

Definition at line 662 of file Instructions.cpp.

References llvm::AttributeSet::addDereferenceableOrNullAttr(), getAttributes(), llvm::Value::getContext(), and setAttributes().

Return the iterator pointing to the beginning of the argument list.

Definition at line 3477 of file Instructions.h.

Referenced by changeToCall(), and Create().

Return the iterator pointing to the beginning of the argument list.

Definition at line 3491 of file Instructions.h.

Return the iterator pointing to the end of the argument list.

Definition at line 3480 of file Instructions.h.

Referenced by changeToCall(), and Create().

Return the iterator pointing to the end of the argument list.

Definition at line 3494 of file Instructions.h.

Iteration adapter for range-for loops.

Definition at line 3486 of file Instructions.h.

References llvm::make_range().

Iteration adapter for range-for loops.

Definition at line 3500 of file Instructions.h.

References llvm::make_range().

Determine if the invoke cannot be duplicated.

Definition at line 3654 of file Instructions.h.

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

Reimplemented from llvm::TerminatorInst.

Definition at line 3730 of file Instructions.h.

References llvm::Instruction::getOpcode().

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

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

Reimplemented from llvm::TerminatorInst.

Definition at line 3733 of file Instructions.h.

InvokeInst * InvokeInst::cloneImpl ( ) const [protected]
static InvokeInst* llvm::InvokeInst::Create ( Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
const Twine NameStr,
Instruction InsertBefore = nullptr 
) [inline, static]
static InvokeInst* llvm::InvokeInst::Create ( Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
ArrayRef< OperandBundleDef Bundles = None,
const Twine NameStr = "",
Instruction InsertBefore = nullptr 
) [inline, static]

Definition at line 3390 of file Instructions.h.

References llvm::Value::getType().

static InvokeInst* llvm::InvokeInst::Create ( FunctionType Ty,
Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
const Twine NameStr,
Instruction InsertBefore = nullptr 
) [inline, static]

Definition at line 3400 of file Instructions.h.

References llvm::None, and llvm::ArrayRef< T >::size().

static InvokeInst* llvm::InvokeInst::Create ( FunctionType Ty,
Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
ArrayRef< OperandBundleDef Bundles = None,
const Twine NameStr = "",
Instruction InsertBefore = nullptr 
) [inline, static]

Definition at line 3408 of file Instructions.h.

References llvm::ArrayRef< T >::size().

static InvokeInst* llvm::InvokeInst::Create ( Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
const Twine NameStr,
BasicBlock InsertAtEnd 
) [inline, static]

Definition at line 3420 of file Instructions.h.

References llvm::None, and llvm::ArrayRef< T >::size().

static InvokeInst* llvm::InvokeInst::Create ( Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
ArrayRef< OperandBundleDef Bundles,
const Twine NameStr,
BasicBlock InsertAtEnd 
) [inline, static]

Definition at line 3428 of file Instructions.h.

References llvm::ArrayRef< T >::size().

InvokeInst * InvokeInst::Create ( InvokeInst II,
ArrayRef< OperandBundleDef Bundles,
Instruction InsertPt = nullptr 
) [static]

Create a clone of II with a different set of operand bundles and insert it before InsertPt.

The returned invoke instruction is identical to II in every way except that the operand bundles for the new instruction are set to the operand bundles in Bundles.

Definition at line 590 of file Instructions.cpp.

References arg_begin(), arg_end(), Create(), getAttributes(), getCalledValue(), getCallingConv(), llvm::Instruction::getDebugLoc(), llvm::Value::getName(), getNormalDest(), getUnwindDest(), setCallingConv(), and llvm::Value::SubclassOptionalData.

Return true if the data operand at index i has the attribute A.

Data operands include invoke arguments and values used in operand bundles, but does not include the invokee operand, or the two successor blocks. This routine dispatches to the underlying AttributeList or the OperandBundleUser as appropriate.

The index i is interpreted as

i == Attribute::ReturnIndex -> the return value i in [1, arg_size + 1) -> argument number (i - 1) i in [arg_size + 1, data_operand_size + 1) -> bundle operand at index (i - 1) in the operand list.

Definition at line 624 of file Instructions.cpp.

References llvm::OperandBundleUser< InvokeInst, User::op_iterator >::bundleOperandHasAttr(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getBundleOperandsStartIndex(), getNumArgOperands(), llvm::User::getNumOperands(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasOperandBundles(), and paramHasAttr().

Provide fast operand accessors.

Determine if the call does not access memory.

Definition at line 3617 of file Instructions.h.

Determine if the parameter or return value is marked with NoAlias attribute.

Parameters:
nThe parameter to check. 1 is the first parameter, 0 is the return

Definition at line 3597 of file Instructions.h.

References llvm::AttributeSet::hasAttribute(), and llvm::NoAlias.

Determine if the call cannot return.

Definition at line 3642 of file Instructions.h.

Determine if the call cannot unwind.

Definition at line 3648 of file Instructions.h.

getArgOperand/setArgOperand - Return/set the i-th invoke argument.

Definition at line 3467 of file Instructions.h.

Wrappers for getting the Use of a invoke argument.

Definition at line 3505 of file Instructions.h.

Definition at line 3509 of file Instructions.h.

getAttributes - Return the parameter attributes for this invoke.

Definition at line 3527 of file Instructions.h.

Referenced by addAttribute(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), changeToCall(), Create(), makeStatepointExplicitImpl(), removeAttribute(), and WriteInstruction().

getCalledFunction - Return the function called, or null if this is an indirect function invocation.

Definition at line 3677 of file Instructions.h.

References llvm::dyn_cast().

Referenced by paramHasAttr().

getCalledValue - Get a pointer to the function that is invoked by this instruction

Definition at line 3683 of file Instructions.h.

Referenced by changeToCall(), Create(), and WriteInstruction().

Definition at line 3684 of file Instructions.h.

getCallingConv/setCallingConv - Get or set the calling convention of this function call.

Definition at line 3516 of file Instructions.h.

Referenced by changeToCall(), Create(), makeStatepointExplicitImpl(), ReplaceWithStatepoint(), and WriteInstruction().

uint64_t llvm::InvokeInst::getDereferenceableBytes ( unsigned  i) const [inline]

Extract the number of dereferenceable bytes for a call or parameter (0=unknown).

Definition at line 3584 of file Instructions.h.

References llvm::AttributeSet::getDereferenceableBytes().

Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).

Definition at line 3590 of file Instructions.h.

References llvm::AttributeSet::getDereferenceableOrNullBytes().

Definition at line 3452 of file Instructions.h.

Referenced by WriteInstruction().

getLandingPadInst - Get the landingpad instruction from the landing pad block (the unwind destination).

Definition at line 668 of file Instructions.cpp.

References llvm::BasicBlock::getFirstNonPHI(), and getUnwindDest().

Referenced by HandleInlinedLandingPad().

getNumArgOperands - Return the number of invoke arguments.

Definition at line 3461 of file Instructions.h.

Referenced by dataOperandHasImpliedAttr(), and paramHasAttr().

Return the number of successors that this terminator has.

Reimplemented from llvm::TerminatorInst.

Definition at line 3727 of file Instructions.h.

Extract the alignment for a call or parameter (0=unknown).

Definition at line 3578 of file Instructions.h.

References llvm::AttributeSet::getParamAlignment().

Return the specified successor.

Reimplemented from llvm::TerminatorInst.

Definition at line 3717 of file Instructions.h.

Determine if any call argument is an aggregate passed by value.

Definition at line 3670 of file Instructions.h.

References llvm::AttributeSet::hasAttrSomewhere().

Determine whether this call has the given attribute.

Definition at line 3547 of file Instructions.h.

Determine whether this call has the given attribute.

Definition at line 3554 of file Instructions.h.

Determine if the call returns a structure through first pointer argument.

Definition at line 3661 of file Instructions.h.

bool llvm::InvokeInst::isNoBuiltin ( ) const [inline]

Return true if the call should not be treated as a call to a builtin.

Definition at line 3603 of file Instructions.h.

bool llvm::InvokeInst::isNoInline ( ) const [inline]

Return true if the call should not be inlined.

Definition at line 3611 of file Instructions.h.

Definition at line 3454 of file Instructions.h.

References llvm::FunctionType::getReturnType().

Determine if the call access memmory only using it's pointer arguments.

Definition at line 3634 of file Instructions.h.

Determine if the call does not access or only reads memory.

Definition at line 3625 of file Instructions.h.

Determine whether the call or the callee has the given attributes.

Definition at line 614 of file Instructions.cpp.

References F, getCalledFunction(), getNumArgOperands(), and llvm::AttributeSet::hasAttribute().

Referenced by dataOperandHasImpliedAttr().

removeAttribute - removes the attribute from the list of attributes.

Definition at line 648 of file Instructions.cpp.

References B, getAttributes(), llvm::Value::getContext(), llvm::AttributeSet::removeAttributes(), and setAttributes().

void llvm::InvokeInst::setArgOperand ( unsigned  i,
Value v 
) [inline]

Definition at line 3471 of file Instructions.h.

setAttributes - Set the parameter attributes for this invoke.

Definition at line 3531 of file Instructions.h.

Referenced by addAttribute(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), HandleCallsInBlockInlinedThroughInvoke(), removeAttribute(), and ReplaceWithStatepoint().

void llvm::InvokeInst::setCalledFunction ( Value Fn) [inline]

setCalledFunction - Set the function called.

Definition at line 3687 of file Instructions.h.

References llvm::Value::getType().

void llvm::InvokeInst::setCalledFunction ( FunctionType FTy,
Value Fn 
) [inline]

Definition at line 3692 of file Instructions.h.

References llvm::Value::getType().

Definition at line 3655 of file Instructions.h.

References llvm::AttributeSet::FunctionIndex.

Definition at line 3620 of file Instructions.h.

References llvm::AttributeSet::FunctionIndex.

Definition at line 3643 of file Instructions.h.

References llvm::AttributeSet::FunctionIndex.

Definition at line 3649 of file Instructions.h.

References llvm::AttributeSet::FunctionIndex.

Definition at line 3612 of file Instructions.h.

References llvm::AttributeSet::FunctionIndex.

Definition at line 3706 of file Instructions.h.

Definition at line 3637 of file Instructions.h.

References llvm::AttributeSet::FunctionIndex.

Definition at line 3628 of file Instructions.h.

References llvm::AttributeSet::FunctionIndex.

void llvm::InvokeInst::setSuccessor ( unsigned  idx,
BasicBlock B 
) [inline]

Update the specified successor to point at the provided block.

Reimplemented from llvm::TerminatorInst.

Definition at line 3722 of file Instructions.h.

Definition at line 3709 of file Instructions.h.

Referenced by TryToMergeLandingPad().


Friends And Related Function Documentation

friend class Instruction [friend]

Definition at line 3377 of file Instructions.h.

friend class OperandBundleUser< InvokeInst, User::op_iterator > [friend]

Definition at line 3372 of file Instructions.h.


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