LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::InvokeInst Class Reference

#include <Instructions.h>

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

Public Member Functions

 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Provide fast operand accessors. More...
 
unsigned getNumArgOperands () const
 
ValuegetArgOperand (unsigned i) const
 
void setArgOperand (unsigned i, Value *v)
 
CallingConv::ID getCallingConv () const
 
void setCallingConv (CallingConv::ID CC)
 
const AttributeSetgetAttributes () const
 
void setAttributes (const AttributeSet &Attrs)
 
void addAttribute (unsigned i, Attribute::AttrKind attr)
 addAttribute - adds the attribute to the list of attributes. More...
 
void removeAttribute (unsigned i, Attribute attr)
 removeAttribute - removes the attribute from the list of attributes. More...
 
bool hasFnAttr (Attribute::AttrKind A) const
 Determine whether this call has the given attribute. More...
 
bool paramHasAttr (unsigned i, Attribute::AttrKind A) const
 Determine whether the call or the callee has the given attributes. More...
 
unsigned getParamAlignment (unsigned i) const
 Extract the alignment for a call or parameter (0=unknown). More...
 
bool isNoBuiltin () const
 Return true if the call should not be treated as a call to a builtin. More...
 
bool isNoInline () const
 Return true if the call should not be inlined. More...
 
void setIsNoInline ()
 
bool doesNotAccessMemory () const
 Determine if the call does not access memory. More...
 
void setDoesNotAccessMemory ()
 
bool onlyReadsMemory () const
 Determine if the call does not access or only reads memory. More...
 
void setOnlyReadsMemory ()
 
bool doesNotReturn () const
 Determine if the call cannot return. More...
 
void setDoesNotReturn ()
 
bool doesNotThrow () const
 Determine if the call cannot unwind. More...
 
void setDoesNotThrow ()
 
bool hasStructRetAttr () const
 Determine if the call returns a structure through first pointer argument. More...
 
bool hasByValArgument () const
 Determine if any call argument is an aggregate passed by value. More...
 
FunctiongetCalledFunction () const
 
const ValuegetCalledValue () const
 
ValuegetCalledValue ()
 
void setCalledFunction (Value *Fn)
 setCalledFunction - Set the function called. More...
 
BasicBlockgetNormalDest () const
 
BasicBlockgetUnwindDest () const
 
void setNormalDest (BasicBlock *B)
 
void setUnwindDest (BasicBlock *B)
 
LandingPadInstgetLandingPadInst () const
 
BasicBlockgetSuccessor (unsigned i) const
 
void setSuccessor (unsigned idx, BasicBlock *NewSucc)
 
unsigned getNumSuccessors () const
 
- Public Member Functions inherited from llvm::TerminatorInst
unsigned getNumSuccessors () const
 
BasicBlockgetSuccessor (unsigned idx) const
 
void setSuccessor (unsigned idx, BasicBlock *B)
 
- Public Member Functions inherited from llvm::Instruction
 ~Instruction ()
 
Instructionuse_back ()
 
const Instructionuse_back () const
 
const BasicBlockgetParent () const
 
BasicBlockgetParent ()
 
void removeFromParent ()
 
void eraseFromParent ()
 
void insertBefore (Instruction *InsertPos)
 
void insertAfter (Instruction *InsertPos)
 
void moveBefore (Instruction *MovePos)
 
unsigned getOpcode () const
 getOpcode() returns a member of one of the enums like Instruction::Add. More...
 
const char * getOpcodeName () const
 
bool isTerminator () const
 
bool isBinaryOp () const
 
bool isShift ()
 
bool isCast () const
 
bool isLogicalShift () const
 
bool isArithmeticShift () const
 isArithmeticShift - Return true if this is an arithmetic shift right. More...
 
bool hasMetadata () const
 
bool hasMetadataOtherThanDebugLoc () const
 
MDNodegetMetadata (unsigned KindID) const
 
MDNodegetMetadata (StringRef Kind) const
 
void getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const
 
void getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const
 
void setMetadata (unsigned KindID, MDNode *Node)
 
void setMetadata (StringRef Kind, MDNode *Node)
 
void setDebugLoc (const DebugLoc &Loc)
 setDebugLoc - Set the debug location information for this instruction. More...
 
const DebugLocgetDebugLoc () const
 getDebugLoc - Return the debug location for this node as a DebugLoc. More...
 
void setHasUnsafeAlgebra (bool B)
 
void setHasNoNaNs (bool B)
 
void setHasNoInfs (bool B)
 
void setHasNoSignedZeros (bool B)
 
void setHasAllowReciprocal (bool B)
 
void setFastMathFlags (FastMathFlags FMF)
 
bool hasUnsafeAlgebra () const
 Determine whether the unsafe-algebra flag is set. More...
 
bool hasNoNaNs () const
 Determine whether the no-NaNs flag is set. More...
 
bool hasNoInfs () const
 Determine whether the no-infs flag is set. More...
 
bool hasNoSignedZeros () const
 Determine whether the no-signed-zeros flag is set. More...
 
bool hasAllowReciprocal () const
 Determine whether the allow-reciprocal flag is set. More...
 
FastMathFlags getFastMathFlags () const
 
void copyFastMathFlags (const Instruction *I)
 Copy I's fast-math flags. More...
 
bool isAssociative () const
 
bool isCommutative () const
 
bool isIdempotent () const
 
bool isNilpotent () const
 
bool mayWriteToMemory () const
 
bool mayReadFromMemory () const
 
bool mayReadOrWriteMemory () const
 
bool mayThrow () const
 
bool mayReturn () const
 
bool mayHaveSideEffects () const
 
Instructionclone () const
 
bool isIdenticalTo (const Instruction *I) const
 
bool isIdenticalToWhenDefined (const Instruction *I) const
 
bool isSameOperationAs (const Instruction *I, unsigned flags=0) const
 Determine if one instruction is the same operation as another. More...
 
bool isUsedOutsideOfBlock (const BasicBlock *BB) const
 
- Public Member Functions inherited from llvm::User
 ~User ()
 
void operator delete (void *Usr)
 operator delete - free memory allocated for User and Use objects More...
 
void operator delete (void *, unsigned)
 placement delete - required by std, but never called. More...
 
void operator delete (void *, unsigned, bool)
 placement delete - required by std, but never called. More...
 
ValuegetOperand (unsigned i) const
 
void setOperand (unsigned i, Value *Val)
 
const UsegetOperandUse (unsigned i) const
 
UsegetOperandUse (unsigned i)
 
unsigned getNumOperands () const
 
op_iterator op_begin ()
 
const_op_iterator op_begin () const
 
op_iterator op_end ()
 
const_op_iterator op_end () const
 
value_op_iterator value_op_begin ()
 
value_op_iterator value_op_end ()
 
void dropAllReferences ()
 
void replaceUsesOfWith (Value *From, Value *To)
 
- Public Member Functions inherited from llvm::Value
virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
Useruse_back ()
 
const Useruse_back () const
 
bool hasOneUse () const
 
bool hasNUses (unsigned N) const
 
bool hasNUsesOrMore (unsigned N) const
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 
unsigned getNumUses () const
 
void addUse (Use &U)
 
unsigned getValueID () const
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 
- Public Member Functions inherited from llvm::ilist_node< Instruction >
InstructiongetPrevNode ()
 Get the previous node, or 0 for the list head. More...
 
const InstructiongetPrevNode () const
 Get the previous node, or 0 for the list head. More...
 
InstructiongetNextNode ()
 Get the next node, or 0 for the list tail. More...
 
const InstructiongetNextNode () const
 Get the next node, or 0 for the list tail. More...
 

Static Public Member Functions

static InvokeInstCreate (Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=0)
 
static InvokeInstCreate (Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, BasicBlock *InsertAtEnd)
 
static bool classof (const Instruction *I)
 
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::TerminatorInst
static bool classof (const Instruction *I)
 
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::Instruction
static const char * getOpcodeName (unsigned OpCode)
 
static bool isTerminator (unsigned OpCode)
 
static bool isBinaryOp (unsigned Opcode)
 
static bool isShift (unsigned Opcode)
 Determine if the Opcode is one of the shift instructions. More...
 
static bool isCast (unsigned OpCode)
 Determine if the OpCode is one of the CastInst instructions. More...
 
static bool isAssociative (unsigned op)
 
static bool isCommutative (unsigned op)
 
static bool isIdempotent (unsigned op)
 
static bool isNilpotent (unsigned op)
 
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
- Static Public Member Functions inherited from llvm::User
static bool classof (const Value *V)
 

Protected Member Functions

virtual InvokeInstclone_impl () const
 
- Protected Member Functions inherited from llvm::TerminatorInst
 TerminatorInst (Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=0)
 
 TerminatorInst (Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
 
 ~TerminatorInst ()
 
- Protected Member Functions inherited from llvm::Instruction
void setInstructionSubclassData (unsigned short D)
 
unsigned getSubclassDataFromInstruction () const
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=0)
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
 
- Protected Member Functions inherited from llvm::User
void * operator new (size_t s, unsigned Us)
 
 User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
 
UseallocHungoffUses (unsigned) const
 
void dropHungoffUses ()
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
- Protected Member Functions inherited from llvm::ilist_node< Instruction >
 ilist_node ()
 

Additional Inherited Members

- Public Types inherited from llvm::Instruction
enum  OperationEquivalenceFlags { CompareIgnoringAlignment = 1<<0, CompareUsingScalarTypes = 1<<1 }
 
enum  TermOps
 
enum  BinaryOps
 
enum  MemoryOps
 
enum  CastOps
 
enum  OtherOps
 
- Public Types inherited from llvm::User
typedef Useop_iterator
 
typedef const Useconst_op_iterator
 
- Public Types inherited from llvm::Value
enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 
- Static Public Attributes inherited from llvm::Value
static const unsigned MaximumAlignment = 1u << 29
 
- Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U >
static UseOpFrom (const U *that)
 
- Protected Attributes inherited from llvm::User
UseOperandList
 
unsigned NumOperands
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 

Detailed Description

InvokeInst - Invoke instruction. The SubclassData field is used to hold the calling convention of the call.

Definition at line 2841 of file Instructions.h.

Member Function Documentation

void InvokeInst::addAttribute ( unsigned  i,
Attribute::AttrKind  attr 
)

addAttribute - adds the attribute to the list of attributes.

Definition at line 593 of file Instructions.cpp.

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

static bool llvm::InvokeInst::classof ( const Instruction I)
inlinestatic

Definition at line 3033 of file Instructions.h.

References llvm::Instruction::getOpcode().

static bool llvm::InvokeInst::classof ( const Value V)
inlinestatic

Definition at line 3036 of file Instructions.h.

InvokeInst * InvokeInst::clone_impl ( ) const
protectedvirtual

Implements llvm::TerminatorInst.

Definition at line 3673 of file Instructions.cpp.

References llvm::User::getNumOperands().

static InvokeInst* llvm::InvokeInst::Create ( Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
const Twine NameStr = "",
Instruction InsertBefore = 0 
)
inlinestatic
static InvokeInst* llvm::InvokeInst::Create ( Value Func,
BasicBlock IfNormal,
BasicBlock IfException,
ArrayRef< Value * >  Args,
const Twine NameStr,
BasicBlock InsertAtEnd 
)
inlinestatic

Definition at line 2871 of file Instructions.h.

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

llvm::InvokeInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Value  )

Provide fast operand accessors.

bool llvm::InvokeInst::doesNotAccessMemory ( ) const
inline

Determine if the call does not access memory.

Definition at line 2946 of file Instructions.h.

References llvm::Attribute::ReadNone.

bool llvm::InvokeInst::doesNotReturn ( ) const
inline

Determine if the call cannot return.

Definition at line 2962 of file Instructions.h.

References llvm::Attribute::NoReturn.

bool llvm::InvokeInst::doesNotThrow ( ) const
inline

Determine if the call cannot unwind.

Definition at line 2968 of file Instructions.h.

References llvm::Attribute::NoUnwind.

Value* llvm::InvokeInst::getArgOperand ( unsigned  i) const
inline

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

Definition at line 2889 of file Instructions.h.

const AttributeSet& llvm::InvokeInst::getAttributes ( ) const
inline

getAttributes - Return the parameter attributes for this invoke.

Definition at line 2903 of file Instructions.h.

Referenced by addAttribute(), changeToCall(), removeAttribute(), and WriteInstruction().

Function* llvm::InvokeInst::getCalledFunction ( ) const
inline

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

Definition at line 2988 of file Instructions.h.

References llvm::dyn_cast().

Referenced by paramHasAttr().

const Value* llvm::InvokeInst::getCalledValue ( ) const
inline

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

Definition at line 2994 of file Instructions.h.

Referenced by changeToCall(), and WriteInstruction().

Value* llvm::InvokeInst::getCalledValue ( )
inline

Definition at line 2995 of file Instructions.h.

CallingConv::ID llvm::InvokeInst::getCallingConv ( ) const
inline

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

Definition at line 2894 of file Instructions.h.

Referenced by changeToCall(), and WriteInstruction().

LandingPadInst * InvokeInst::getLandingPadInst ( ) const

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

Definition at line 607 of file Instructions.cpp.

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

Referenced by HandleInlinedInvoke().

BasicBlock* llvm::InvokeInst::getNormalDest ( ) const
inline
unsigned llvm::InvokeInst::getNumArgOperands ( ) const
inline

getNumArgOperands - Return the number of invoke arguments.

Definition at line 2885 of file Instructions.h.

unsigned llvm::InvokeInst::getNumSuccessors ( ) const
inline

Definition at line 3030 of file Instructions.h.

unsigned llvm::InvokeInst::getParamAlignment ( unsigned  i) const
inline

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

Definition at line 2926 of file Instructions.h.

References llvm::AttributeSet::getParamAlignment().

BasicBlock* llvm::InvokeInst::getSuccessor ( unsigned  i) const
inline

Definition at line 3020 of file Instructions.h.

BasicBlock* llvm::InvokeInst::getUnwindDest ( ) const
inline
bool llvm::InvokeInst::hasByValArgument ( ) const
inline

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

Definition at line 2981 of file Instructions.h.

References llvm::Attribute::ByVal, and llvm::AttributeSet::hasAttrSomewhere().

bool llvm::InvokeInst::hasFnAttr ( Attribute::AttrKind  A) const
inline

Determine whether this call has the given attribute.

Definition at line 2916 of file Instructions.h.

References llvm::Attribute::NoBuiltin.

bool llvm::InvokeInst::hasStructRetAttr ( ) const
inline

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

Definition at line 2975 of file Instructions.h.

References llvm::Attribute::StructRet.

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

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

Definition at line 2932 of file Instructions.h.

References llvm::Attribute::Builtin, and llvm::Attribute::NoBuiltin.

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

Return true if the call should not be inlined.

Definition at line 2940 of file Instructions.h.

References llvm::Attribute::NoInline.

bool llvm::InvokeInst::onlyReadsMemory ( ) const
inline

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

Definition at line 2954 of file Instructions.h.

References llvm::Attribute::ReadOnly.

bool InvokeInst::paramHasAttr ( unsigned  i,
Attribute::AttrKind  A 
) const

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

Definition at line 585 of file Instructions.cpp.

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

void InvokeInst::removeAttribute ( unsigned  i,
Attribute  attr 
)

removeAttribute - removes the attribute from the list of attributes.

Definition at line 599 of file Instructions.cpp.

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

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

Definition at line 2890 of file Instructions.h.

void llvm::InvokeInst::setAttributes ( const AttributeSet Attrs)
inline

setAttributes - Set the parameter attributes for this invoke.

Definition at line 2907 of file Instructions.h.

Referenced by addAttribute(), and removeAttribute().

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

setCalledFunction - Set the function called.

Definition at line 2998 of file Instructions.h.

void llvm::InvokeInst::setCallingConv ( CallingConv::ID  CC)
inline

Definition at line 2897 of file Instructions.h.

void llvm::InvokeInst::setDoesNotAccessMemory ( )
inline

Definition at line 2949 of file Instructions.h.

References llvm::Attribute::ReadNone.

void llvm::InvokeInst::setDoesNotReturn ( )
inline

Definition at line 2963 of file Instructions.h.

References llvm::Attribute::NoReturn.

void llvm::InvokeInst::setDoesNotThrow ( )
inline

Definition at line 2969 of file Instructions.h.

References llvm::Attribute::NoUnwind.

void llvm::InvokeInst::setIsNoInline ( )
inline

Definition at line 2941 of file Instructions.h.

References llvm::Attribute::NoInline.

void llvm::InvokeInst::setNormalDest ( BasicBlock B)
inline

Definition at line 3009 of file Instructions.h.

void llvm::InvokeInst::setOnlyReadsMemory ( )
inline

Definition at line 2957 of file Instructions.h.

References llvm::Attribute::ReadOnly.

void llvm::InvokeInst::setSuccessor ( unsigned  idx,
BasicBlock NewSucc 
)
inline

Definition at line 3025 of file Instructions.h.

void llvm::InvokeInst::setUnwindDest ( BasicBlock B)
inline

Definition at line 3012 of file Instructions.h.


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