LLVM API Documentation

llvm::CallSite Class Reference

#include <CallSite.h>

Collaboration diagram for llvm::CallSite:
[legend]

List of all members.

Public Types

typedef User::op_iterator arg_iterator

Public Member Functions

 CallSite ()
 CallSite (CallInst *CI)
 CallSite (InvokeInst *II)
 CallSite (Instruction *C)
 CallSite (const CallSite &CS)
CallSite & operator= (const CallSite &CS)
bool operator== (const CallSite &CS) const
bool operator!= (const CallSite &CS) const
unsigned getCallingConv () const
void setCallingConv (unsigned CC)
const AttrListPtr & getAttributes () const
void setAttributes (const AttrListPtr &PAL)
bool paramHasAttr (uint16_t i, Attributes attr) const
 paramHasAttr - whether the call or the callee has the given attribute.
uint16_t getParamAlignment (uint16_t 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 doesNotAccessMemory=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)
const Type * getType () const
bool isCall () const
bool isInvoke () const
Instruction * getInstruction () const
Function * getCaller () const
Value * getCalledValue () const
Function * getCalledFunction () const
void setCalledFunction (Value *V)
Value * getArgument (unsigned ArgNo) const
void setArgument (unsigned ArgNo, Value *newVal)
unsigned getArgumentNo (unsigned OperandNo) const
bool hasArgument (const Value *Arg) const
arg_iterator arg_begin () const
arg_iterator arg_end () const
bool arg_empty () const
unsigned arg_size () const
bool operator< (const CallSite &CS) const
bool isCallee (Value::use_iterator UI) const

Static Public Member Functions

static CallSite get (Value *V)


Detailed Description

Definition at line 36 of file CallSite.h.


Member Typedef Documentation

arg_iterator - The type of iterator to use when looping over actual arguments at this call site...

Definition at line 165 of file CallSite.h.


Constructor & Destructor Documentation

llvm::CallSite::CallSite (  )  [inline]

Definition at line 39 of file CallSite.h.

Referenced by get().

llvm::CallSite::CallSite ( CallInst *  CI  )  [inline]

Definition at line 40 of file CallSite.h.

llvm::CallSite::CallSite ( InvokeInst *  II  )  [inline]

Definition at line 41 of file CallSite.h.

CallSite::CallSite ( Instruction *  C  ) 

Definition at line 41 of file Instructions.cpp.

llvm::CallSite::CallSite ( const CallSite &  CS  )  [inline]

Definition at line 43 of file CallSite.h.


Member Function Documentation

CallSite& llvm::CallSite::operator= ( const CallSite &  CS  )  [inline]

Definition at line 44 of file CallSite.h.

References I.

bool llvm::CallSite::operator== ( const CallSite &  CS  )  const [inline]

Definition at line 46 of file CallSite.h.

References I.

bool llvm::CallSite::operator!= ( const CallSite &  CS  )  const [inline]

Definition at line 47 of file CallSite.h.

References I.

static CallSite llvm::CallSite::get ( Value *  V  )  [inline, static]

CallSite::get - This static method is sort of like a constructor. It will create an appropriate call site for a Call or Invoke instruction, but it can also create a null initialized CallSite object for something which is NOT a call site.

Definition at line 54 of file CallSite.h.

References Call, CallSite(), and V.

Referenced by AddressIsTaken(), AllCalleesPassInValidPointerForArgument(), llvm::AliasSetTracker::deleteValue(), llvm::MemoryDependenceAnalysis::getDependency(), llvm::BasicInlinerImpl::inlineFunctions(), llvm::PointerMayBeCaptured(), llvm::Inliner::runOnSCC(), and UpdateCallGraphAfterInlining().

unsigned CallSite::getCallingConv (  )  const

getCallingConv/setCallingConv - get or set the calling convention of the call.

Definition at line 46 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

Referenced by llvm::SelectionDAGLowering::LowerCallTo().

void CallSite::setCallingConv ( unsigned  CC  ) 

Definition at line 49 of file Instructions.cpp.

References CALLSITE_DELEGATE_SETTER.

Referenced by ChangeCalleesToFastCall().

const AttrListPtr & CallSite::getAttributes (  )  const

getAttributes/setAttributes - get or set the parameter attributes of the call.

Definition at line 52 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

Referenced by LLVMAddInstrAttribute(), LLVMRemoveInstrAttribute(), LLVMSetInstrParamAlignment(), and RemoveNestAttribute().

void CallSite::setAttributes ( const AttrListPtr &  PAL  ) 

bool CallSite::paramHasAttr ( uint16_t  i,
Attributes  attr 
) const

paramHasAttr - whether the call or the callee has the given attribute.

Definition at line 58 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

Referenced by isSafeToEliminateVarargsCast(), llvm::SelectionDAGLowering::LowerCallTo(), llvm::PointerMayBeCaptured(), and llvm::Interpreter::visitCallSite().

uint16_t CallSite::getParamAlignment ( uint16_t  i  )  const

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

Definition at line 61 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

Referenced by llvm::SelectionDAGLowering::LowerCallTo().

bool CallSite::doesNotAccessMemory (  )  const

Determine if the call does not access memory.

Definition at line 64 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

Referenced by llvm::AliasAnalysis::getModRefBehavior().

void CallSite::setDoesNotAccessMemory ( bool  doesNotAccessMemory = true  ) 

Definition at line 67 of file Instructions.cpp.

References CALLSITE_DELEGATE_SETTER.

bool CallSite::onlyReadsMemory (  )  const

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

Definition at line 70 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

Referenced by llvm::AliasAnalysis::getModRefBehavior(), and llvm::PointerMayBeCaptured().

void CallSite::setOnlyReadsMemory ( bool  onlyReadsMemory = true  ) 

Definition at line 73 of file Instructions.cpp.

References CALLSITE_DELEGATE_SETTER.

bool CallSite::doesNotReturn (  )  const

Determine if the call cannot return.

Definition at line 76 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

void CallSite::setDoesNotReturn ( bool  doesNotReturn = true  ) 

Definition at line 79 of file Instructions.cpp.

References CALLSITE_DELEGATE_SETTER.

bool CallSite::doesNotThrow (  )  const

Determine if the call cannot unwind.

Definition at line 82 of file Instructions.cpp.

References CALLSITE_DELEGATE_GETTER.

Referenced by llvm::InlineFunction().

void CallSite::setDoesNotThrow ( bool  doesNotThrow = true  ) 

Definition at line 85 of file Instructions.cpp.

References CALLSITE_DELEGATE_SETTER.

const Type* llvm::CallSite::getType (  )  const [inline]

getType - Return the type of the instruction that generated this call site

Definition at line 98 of file CallSite.h.

References getInstruction(), and llvm::Value::getType().

Referenced by llvm::SelectionDAGLowering::LowerCallTo().

bool llvm::CallSite::isCall (  )  const [inline]

isCall - true if a CallInst is enclosed. Note that !isCall() does not mean it is an InvokeInst enclosed, it also could signify a NULL Instruction pointer.

Definition at line 103 of file CallSite.h.

bool llvm::CallSite::isInvoke (  )  const [inline]

isInvoke - true if a InvokeInst is enclosed.

Definition at line 107 of file CallSite.h.

References getInstruction().

Instruction* llvm::CallSite::getInstruction (  )  const [inline]

Function* llvm::CallSite::getCaller (  )  const [inline]

getCaller - Return the caller function for this call site

Definition at line 115 of file CallSite.h.

References getInstruction(), llvm::BasicBlock::getParent(), and llvm::Instruction::getParent().

Referenced by InlineCallIfPossible(), and llvm::Inliner::runOnSCC().

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

getCalledValue - Return the pointer to function that is being called...

Definition at line 120 of file CallSite.h.

References getInstruction(), and llvm::User::getOperand().

Referenced by getCalledFunction(), llvm::SelectionDAGLowering::LowerCallTo(), and llvm::Interpreter::visitCallSite().

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

void llvm::CallSite::setCalledFunction ( Value *  V  )  [inline]

setCalledFunction - Set the callee to the specified value...

Definition at line 134 of file CallSite.h.

References getInstruction(), and llvm::User::setOperand().

Value* llvm::CallSite::getArgument ( unsigned  ArgNo  )  const [inline]

Definition at line 139 of file CallSite.h.

References arg_begin(), and arg_end().

Referenced by AllCalleesPassInValidPointerForArgument(), and SpecializeFunction().

void llvm::CallSite::setArgument ( unsigned  ArgNo,
Value *  newVal 
) [inline]

Definition at line 144 of file CallSite.h.

References arg_begin(), arg_end(), getInstruction(), and llvm::User::setOperand().

unsigned llvm::CallSite::getArgumentNo ( unsigned  OperandNo  )  const [inline]

Given an operand number, returns the argument that corresponds to it. OperandNo must be a valid operand number that actually corresponds to an argument.

Definition at line 153 of file CallSite.h.

bool CallSite::hasArgument ( const Value *  Arg  )  const

hasArgument - Returns true if this CallSite passes the given Value* as an argument to the called function.

Definition at line 89 of file Instructions.cpp.

References AI, arg_begin(), arg_end(), and E.

Referenced by AddressIsTaken().

arg_iterator llvm::CallSite::arg_begin (  )  const [inline]

arg_iterator llvm::CallSite::arg_end (  )  const [inline]

bool llvm::CallSite::arg_empty (  )  const [inline]

Definition at line 176 of file CallSite.h.

References arg_begin(), and arg_end().

unsigned llvm::CallSite::arg_size (  )  const [inline]

bool llvm::CallSite::operator< ( const CallSite &  CS  )  const [inline]

Definition at line 179 of file CallSite.h.

References getInstruction().

bool llvm::CallSite::isCallee ( Value::use_iterator  UI  )  const [inline]


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