LLVM API Documentation

llvm::CallInst Class Reference

#include <Instructions.h>

Inheritance diagram for llvm::CallInst:
[legend]
Collaboration diagram for llvm::CallInst:
[legend]

List of all members.

Public Member Functions

 ~CallInst ()
bool isTailCall () const
void setTailCall (bool isTC=true)
virtual CallInst * clone (LLVMContext &Context) const
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Provide fast operand accessors.
unsigned getCallingConv () const
void setCallingConv (unsigned CC)
const AttrListPtr & getAttributes () const
void setAttributes (const AttrListPtr &Attrs)
void addAttribute (unsigned i, Attributes attr)
 addAttribute - adds the attribute to the list of attributes.
void removeAttribute (unsigned i, Attributes attr)
 removeAttribute - removes the attribute from the list of attributes.
bool paramHasAttr (unsigned i, Attributes attr) const
 Determine whether the call or the callee has the given attribute.
unsigned getParamAlignment (unsigned i) const
 Extract the alignment for a call or parameter (0=unknown).
bool doesNotAccessMemory () const
 Determine if the call does not access memory.
void setDoesNotAccessMemory (bool NotAccessMemory=true)
bool onlyReadsMemory () const
 Determine if the call does not access or only reads memory.
void setOnlyReadsMemory (bool OnlyReadsMemory=true)
bool doesNotReturn () const
 Determine if the call cannot return.
void setDoesNotReturn (bool DoesNotReturn=true)
bool doesNotThrow () const
 Determine if the call cannot unwind.
void setDoesNotThrow (bool DoesNotThrow=true)
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.
Function * getCalledFunction () const
const Value * getCalledValue () const
Value * getCalledValue ()

Static Public Member Functions

template<typename InputIterator>
static CallInst * Create (Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const Twine &NameStr="", Instruction *InsertBefore=0)
template<typename InputIterator>
static CallInst * Create (Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const Twine &NameStr, BasicBlock *InsertAtEnd)
static CallInst * Create (Value *F, Value *Actual, const Twine &NameStr="", Instruction *InsertBefore=0)
static CallInst * Create (Value *F, Value *Actual, const Twine &NameStr, BasicBlock *InsertAtEnd)
static CallInst * Create (Value *F, const Twine &NameStr="", Instruction *InsertBefore=0)
static CallInst * Create (Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd)
static bool classof (const CallInst *)
static bool classof (const Instruction *I)
 Methods for support type inquiry through isa, cast, and dyn_cast:.
static bool classof (const Value *V)


Detailed Description

CallInst - This class represents a function call, abstracting a target machine's calling convention. This class uses low bit of the SubClassData field to indicate whether or not this is a tail call. The rest of the bits hold the calling convention of the call.

Definition at line 938 of file Instructions.h.


Constructor & Destructor Documentation

CallInst::~CallInst (  ) 

Definition at line 279 of file Instructions.cpp.


Member Function Documentation

template<typename InputIterator>
static CallInst* llvm::CallInst::Create ( Value *  Func,
InputIterator  ArgBegin,
InputIterator  ArgEnd,
const Twine &  NameStr = "",
Instruction *  InsertBefore = 0 
) [inline, static]

template<typename InputIterator>
static CallInst* llvm::CallInst::Create ( Value *  Func,
InputIterator  ArgBegin,
InputIterator  ArgEnd,
const Twine &  NameStr,
BasicBlock *  InsertAtEnd 
) [inline, static]

Definition at line 996 of file Instructions.h.

static CallInst* llvm::CallInst::Create ( Value *  F,
Value *  Actual,
const Twine &  NameStr = "",
Instruction *  InsertBefore = 0 
) [inline, static]

Definition at line 1002 of file Instructions.h.

static CallInst* llvm::CallInst::Create ( Value *  F,
Value *  Actual,
const Twine &  NameStr,
BasicBlock *  InsertAtEnd 
) [inline, static]

Definition at line 1007 of file Instructions.h.

static CallInst* llvm::CallInst::Create ( Value *  F,
const Twine &  NameStr = "",
Instruction *  InsertBefore = 0 
) [inline, static]

Definition at line 1011 of file Instructions.h.

static CallInst* llvm::CallInst::Create ( Value *  F,
const Twine &  NameStr,
BasicBlock *  InsertAtEnd 
) [inline, static]

Definition at line 1015 of file Instructions.h.

bool llvm::CallInst::isTailCall (  )  const [inline]

Definition at line 1022 of file Instructions.h.

Referenced by llvm::UpgradeIntrinsicCall(), and WriteInstruction().

void llvm::CallInst::setTailCall ( bool  isTC = true  )  [inline]

Definition at line 1023 of file Instructions.h.

Referenced by llvm::JIT::runFunction(), ThunkGToF(), and llvm::UpgradeIntrinsicCall().

CallInst * CallInst::clone ( LLVMContext &  Context  )  const [virtual]

clone() - Create a copy of 'this' instruction that is identical in all ways except the following: The instruction has no parent The instruction has no name

Implements llvm::Instruction.

Definition at line 3008 of file Instructions.cpp.

References llvm::User::getNumOperands(), and llvm::Value::SubclassOptionalData.

Referenced by llvm::InlineFunction().

llvm::CallInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Value   ) 

Provide fast operand accessors.

unsigned llvm::CallInst::getCallingConv (  )  const [inline]

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

Definition at line 1034 of file Instructions.h.

Referenced by HandleInlinedInvoke(), llvm::UpgradeIntrinsicCall(), and WriteInstruction().

void llvm::CallInst::setCallingConv ( unsigned  CC  )  [inline]

Definition at line 1035 of file Instructions.h.

Referenced by llvm::JIT::runFunction(), ThunkGToF(), and llvm::UpgradeIntrinsicCall().

const AttrListPtr& llvm::CallInst::getAttributes (  )  const [inline]

getAttributes - Return the parameter attributes for this call.

Definition at line 1041 of file Instructions.h.

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

void llvm::CallInst::setAttributes ( const AttrListPtr &  Attrs  )  [inline]

setAttributes - Set the parameter attributes for this call.

Definition at line 1045 of file Instructions.h.

Referenced by addAttribute(), and removeAttribute().

void CallInst::addAttribute ( unsigned  i,
Attributes  attr 
)

addAttribute - adds the attribute to the list of attributes.

Definition at line 410 of file Instructions.cpp.

References llvm::AttrListPtr::addAttr(), getAttributes(), and setAttributes().

void CallInst::removeAttribute ( unsigned  i,
Attributes  attr 
)

removeAttribute - removes the attribute from the list of attributes.

Definition at line 416 of file Instructions.cpp.

References getAttributes(), llvm::AttrListPtr::removeAttr(), and setAttributes().

bool CallInst::paramHasAttr ( unsigned  i,
Attributes  attr 
) const

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

Definition at line 422 of file Instructions.cpp.

References F, getCalledFunction(), and llvm::AttrListPtr::paramHasAttr().

unsigned llvm::CallInst::getParamAlignment ( unsigned  i  )  const [inline]

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

Definition at line 1057 of file Instructions.h.

bool llvm::CallInst::doesNotAccessMemory (  )  const [inline]

Determine if the call does not access memory.

Definition at line 1062 of file Instructions.h.

References llvm::Attribute::ReadNone.

void llvm::CallInst::setDoesNotAccessMemory ( bool  NotAccessMemory = true  )  [inline]

Definition at line 1065 of file Instructions.h.

References llvm::Attribute::ReadNone.

bool llvm::CallInst::onlyReadsMemory (  )  const [inline]

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

Definition at line 1071 of file Instructions.h.

References llvm::Attribute::ReadOnly.

void llvm::CallInst::setOnlyReadsMemory ( bool  OnlyReadsMemory = true  )  [inline]

Definition at line 1074 of file Instructions.h.

References llvm::Attribute::ReadNone, and llvm::Attribute::ReadOnly.

bool llvm::CallInst::doesNotReturn (  )  const [inline]

Determine if the call cannot return.

Definition at line 1080 of file Instructions.h.

References llvm::Attribute::NoReturn.

void llvm::CallInst::setDoesNotReturn ( bool  DoesNotReturn = true  )  [inline]

Definition at line 1083 of file Instructions.h.

References llvm::Attribute::NoReturn.

bool llvm::CallInst::doesNotThrow (  )  const [inline]

Determine if the call cannot unwind.

Definition at line 1089 of file Instructions.h.

References llvm::Attribute::NoUnwind.

Referenced by HandleInlinedInvoke().

void llvm::CallInst::setDoesNotThrow ( bool  DoesNotThrow = true  )  [inline]

Definition at line 1092 of file Instructions.h.

References llvm::Attribute::NoUnwind.

bool llvm::CallInst::hasStructRetAttr (  )  const [inline]

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

Definition at line 1099 of file Instructions.h.

References llvm::Attribute::StructRet.

bool llvm::CallInst::hasByValArgument (  )  const [inline]

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

Definition at line 1105 of file Instructions.h.

References llvm::Attribute::ByVal.

Function* llvm::CallInst::getCalledFunction (  )  const [inline]

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

Definition at line 1112 of file Instructions.h.

References llvm::dyn_cast().

Referenced by llvm::IntrinsicInst::classof(), llvm::IntrinsicInst::getIntrinsicID(), llvm::IntrinsicLowering::LowerIntrinsicCall(), paramHasAttr(), and llvm::UpgradeIntrinsicCall().

const Value* llvm::CallInst::getCalledValue (  )  const [inline]

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

Definition at line 1118 of file Instructions.h.

Referenced by llvm::X86TargetLowering::ExpandInlineAsm(), and HandleInlinedInvoke().

Value* llvm::CallInst::getCalledValue (  )  [inline]

Definition at line 1119 of file Instructions.h.

static bool llvm::CallInst::classof ( const CallInst *   )  [inline, static]

Reimplemented in llvm::IntrinsicInst.

Definition at line 1122 of file Instructions.h.

static bool llvm::CallInst::classof ( const Instruction *   )  [inline, static]

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

Reimplemented from llvm::Instruction.

Definition at line 1123 of file Instructions.h.

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

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


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