LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::CallInst Class Reference

#include <Instructions.h>

Inheritance diagram for llvm::CallInst:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~CallInst ()
virtual CallInstclone () const
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Provide fast operand accessors.
bool isTailCall () const
void setTailCall (bool isTC=true)
unsigned getCallingConv () const
void setCallingConv (unsigned CC)
const PAListPtrgetParamAttrs () const
void setParamAttrs (const PAListPtr &Attrs)
 setParamAttrs - Sets the parameter attributes for this call.
void addParamAttr (unsigned i, ParameterAttributes attr)
 addParamAttr - adds the attribute to the list of attributes.
void removeParamAttr (unsigned i, ParameterAttributes attr)
 removeParamAttr - removes the attribute from the list of attributes.
bool paramHasAttr (unsigned i, unsigned 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.
FunctiongetCalledFunction () const
const ValuegetCalledValue () const
ValuegetCalledValue ()

Static Public Member Functions

template<typename InputIterator>
CallInstCreate (Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const std::string &NameStr="", Instruction *InsertBefore=0)
template<typename InputIterator>
CallInstCreate (Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const std::string &NameStr, BasicBlock *InsertAtEnd)
CallInstCreate (Value *F, Value *Actual, const std::string &NameStr="", Instruction *InsertBefore=0)
CallInstCreate (Value *F, Value *Actual, const std::string &NameStr, BasicBlock *InsertAtEnd)
CallInstCreate (Value *F, const std::string &NameStr="", Instruction *InsertBefore=0)
CallInstCreate (Value *F, const std::string &NameStr, BasicBlock *InsertAtEnd)
bool classof (const CallInst *)
bool classof (const Instruction *I)
 Methods for support type inquiry through isa, cast, and dyn_cast:.
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 963 of file Instructions.h.


Constructor & Destructor Documentation

CallInst::~CallInst  ) 
 

Definition at line 275 of file Instructions.cpp.


Member Function Documentation

void CallInst::addParamAttr unsigned  i,
ParameterAttributes  attr
 

addParamAttr - adds the attribute to the list of attributes.

Definition at line 405 of file Instructions.cpp.

References llvm::PAListPtr::addAttr(), getParamAttrs(), llvm::ParameterAttributes, and setParamAttrs().

Referenced by setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), and setOnlyReadsMemory().

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

Reimplemented from llvm::Instruction.

Reimplemented in llvm::IntrinsicInst, llvm::DbgInfoIntrinsic, llvm::DbgStopPointInst, llvm::DbgFuncStartInst, llvm::DbgRegionStartInst, llvm::DbgRegionEndInst, llvm::DbgDeclareInst, llvm::MemIntrinsic, llvm::MemCpyInst, llvm::MemMoveInst, llvm::MemSetInst, and llvm::EHSelectorInst.

Definition at line 1150 of file Instructions.h.

References classof().

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

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

Reimplemented from llvm::Instruction.

Definition at line 1147 of file Instructions.h.

References llvm::Instruction::getOpcode().

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

Reimplemented in llvm::IntrinsicInst.

Definition at line 1146 of file Instructions.h.

Referenced by classof().

CallInst * CallInst::clone  )  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 2887 of file Instructions.cpp.

References llvm::User::getNumOperands().

CallInst* llvm::CallInst::Create Value F,
const std::string &  NameStr,
BasicBlock InsertAtEnd
[inline, static]
 

Definition at line 1040 of file Instructions.h.

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

Definition at line 1036 of file Instructions.h.

CallInst* llvm::CallInst::Create Value F,
Value Actual,
const std::string &  NameStr,
BasicBlock InsertAtEnd
[inline, static]
 

Definition at line 1032 of file Instructions.h.

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

Definition at line 1027 of file Instructions.h.

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

Definition at line 1021 of file Instructions.h.

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

Definition at line 1013 of file Instructions.h.

Referenced by llvm::InlineFunction(), LowerPartSelect(), LowerPartSet(), ReplaceCallWith(), and llvm::UpgradeIntrinsicCall().

llvm::CallInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS Value   ) 
 

Provide fast operand accessors.

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

Determine if the call does not access memory.

Definition at line 1086 of file Instructions.h.

References paramHasAttr().

Referenced by llvm::CallSite::doesNotAccessMemory(), llvm::Instruction::mayReadFromMemory(), and onlyReadsMemory().

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

Determine if the call cannot return.

Definition at line 1104 of file Instructions.h.

References paramHasAttr().

Referenced by llvm::CallSite::doesNotReturn(), MarkAliveBlocks(), and PruneEH::SimplifyFunction().

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

Determine if the call cannot unwind.

Definition at line 1113 of file Instructions.h.

References paramHasAttr().

Referenced by llvm::CallSite::doesNotThrow(), HandleInlinedInvoke(), and PruneEH::runOnSCC().

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

getCalledFunction - Return the function being called by this instruction if it is a direct call. If it is a call through a function pointer, return null.

Definition at line 1136 of file Instructions.h.

References llvm::User::getOperand().

Referenced by CanConstantFold(), llvm::CannotBeNegativeZero(), llvm::IntrinsicInst::classof(), PruneEH::DeleteBasicBlock(), GVExtractorPass::deleteGV(), getNextStopPoint(), llvm::SourceFunctionInfo::getSourceLocation(), CodeExtractor::isEligible(), ValueTable::lookup_or_add(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerPartSelect(), LowerPartSet(), EscapeEnumerator::Next(), LibCallOptimization::OptimizeCall(), SimplifyLibCalls::runOnFunction(), PruneEH::runOnSCC(), llvm::UpgradeIntrinsicCall(), Verifier::visitCallInst(), LowerSetJmp::visitCallInst(), and Verifier::visitIntrinsicFunctionCall().

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

Definition at line 1143 of file Instructions.h.

References llvm::User::getOperand().

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

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

Definition at line 1142 of file Instructions.h.

References llvm::User::getOperand().

Referenced by llvm::X86TargetAsmInfo::ExpandInlineAsm(), HandleInlinedInvoke(), and LowerSetJmp::visitCallInst().

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

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

Definition at line 1059 of file Instructions.h.

Referenced by llvm::CallSite::getCallingConv(), HandleInlinedInvoke(), LLVMGetInstructionCallConv(), EscapeEnumerator::Next(), llvm::UpgradeIntrinsicCall(), LowerSetJmp::visitCallInst(), and WriteInstruction().

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

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

Definition at line 1081 of file Instructions.h.

References llvm::PAListPtr::getParamAlignment().

Referenced by llvm::CallSite::getParamAlignment().

const PAListPtr& llvm::CallInst::getParamAttrs  )  const [inline]
 

getParamAttrs - Return the parameter attributes for this call.

Definition at line 1066 of file Instructions.h.

Referenced by addParamAttr(), llvm::CallSite::getParamAttrs(), HandleInlinedInvoke(), EscapeEnumerator::Next(), removeParamAttr(), llvm::ValueEnumerator::ValueEnumerator(), LowerSetJmp::visitCallInst(), and WriteInstruction().

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

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

Definition at line 1129 of file Instructions.h.

References llvm::PAListPtr::hasAttrSomewhere().

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

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

Definition at line 1123 of file Instructions.h.

References paramHasAttr().

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

Definition at line 1052 of file Instructions.h.

Referenced by BasicAliasAnalysis::getModRefInfo(), llvm::Instruction::isIdenticalTo(), llvm::Instruction::isSameOperationAs(), llvm::UpgradeIntrinsicCall(), and WriteInstruction().

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

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

Definition at line 1095 of file Instructions.h.

References doesNotAccessMemory(), and paramHasAttr().

Referenced by llvm::Instruction::mayWriteToMemory(), and llvm::CallSite::onlyReadsMemory().

bool llvm::CallInst::paramHasAttr unsigned  i,
unsigned  attr
const
 

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

Referenced by doesNotAccessMemory(), doesNotReturn(), doesNotThrow(), hasStructRetAttr(), onlyReadsMemory(), and llvm::CallSite::paramHasAttr().

void CallInst::removeParamAttr unsigned  i,
ParameterAttributes  attr
 

removeParamAttr - removes the attribute from the list of attributes.

Definition at line 411 of file Instructions.cpp.

References getParamAttrs(), llvm::ParameterAttributes, llvm::PAListPtr::removeAttr(), and setParamAttrs().

Referenced by setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), and setOnlyReadsMemory().

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

Definition at line 1060 of file Instructions.h.

Referenced by ChangeToCall(), LLVMSetInstructionCallConv(), llvm::CallSite::setCallingConv(), llvm::SimplifyCFG(), and llvm::UpgradeIntrinsicCall().

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

Definition at line 1089 of file Instructions.h.

References addParamAttr(), and removeParamAttr().

Referenced by llvm::CallSite::setDoesNotAccessMemory().

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

Definition at line 1107 of file Instructions.h.

References addParamAttr(), and removeParamAttr().

Referenced by llvm::CallSite::setDoesNotReturn().

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

Definition at line 1116 of file Instructions.h.

References addParamAttr(), and removeParamAttr().

Referenced by llvm::InlineFunction(), and llvm::CallSite::setDoesNotThrow().

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

Definition at line 1098 of file Instructions.h.

References addParamAttr(), and removeParamAttr().

Referenced by llvm::CallSite::setOnlyReadsMemory().

void llvm::CallInst::setParamAttrs const PAListPtr Attrs  )  [inline]
 

setParamAttrs - Sets the parameter attributes for this call.

Definition at line 1069 of file Instructions.h.

Referenced by addParamAttr(), ChangeToCall(), removeParamAttr(), llvm::CallSite::setParamAttrs(), and llvm::SimplifyCFG().

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

Definition at line 1053 of file Instructions.h.

Referenced by llvm::InlineFunction(), llvm::JIT::runFunction(), LowerAllocations::runOnBasicBlock(), TailCallElim::runOnFunction(), and llvm::UpgradeIntrinsicCall().


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


This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.