LLVM API Documentation
#include <Instructions.h>


Public Member Functions | |
| ~CallInst () | |
| bool | isTailCall () const |
| void | setTailCall (bool isTC=true) |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
| Provide fast operand accessors. | |
| unsigned | getNumArgOperands () const |
| Value * | getArgOperand (unsigned i) const |
| void | setArgOperand (unsigned i, Value *v) |
| CallingConv::ID | getCallingConv () const |
| void | setCallingConv (CallingConv::ID CC) |
| const AttributeSet & | getAttributes () const |
| void | setAttributes (const AttributeSet &Attrs) |
| 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. | |
| bool | hasFnAttr (Attribute::AttrKind 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. | |
| unsigned | getParamAlignment (unsigned i) const |
| Extract the alignment for a call or parameter (0=unknown). | |
| bool | isNoInline () const |
| Return true if the call should not be inlined. | |
| void | setIsNoInline () |
| bool | canReturnTwice () const |
| Return true if the call can return twice. | |
| void | setCanReturnTwice () |
| 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 | 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 call 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. | |
| Function * | getCalledFunction () const |
| const Value * | getCalledValue () const |
| Value * | getCalledValue () |
| void | setCalledFunction (Value *Fn) |
| setCalledFunction - Set the function called. | |
| bool | isInlineAsm () const |
| isInlineAsm - Check if this call is an inline asm statement. | |
Static Public Member Functions | |
| static CallInst * | Create (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=0) |
| static CallInst * | Create (Value *Func, ArrayRef< Value * > Args, 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 Instruction * | CreateMalloc (Instruction *InsertBefore, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=0, Function *MallocF=0, const Twine &Name="") |
| static Instruction * | CreateMalloc (BasicBlock *InsertAtEnd, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=0, Function *MallocF=0, const Twine &Name="") |
| static Instruction * | CreateFree (Value *Source, Instruction *InsertBefore) |
| CreateFree - Generate the IR for a call to the builtin free function. | |
| static Instruction * | CreateFree (Value *Source, BasicBlock *InsertAtEnd) |
| 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 | |
| virtual CallInst * | clone_impl () const |
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 1169 of file Instructions.h.
| CallInst::~CallInst | ( | ) |
Definition at line 263 of file Instructions.cpp.
| void CallInst::addAttribute | ( | unsigned | i, |
| Attribute::AttrKind | attr | ||
| ) |
addAttribute - adds the attribute to the list of attributes.
Definition at line 334 of file Instructions.cpp.
References llvm::AttributeSet::addAttribute(), getAttributes(), llvm::Value::getContext(), and setAttributes().
Referenced by setCannotDuplicate(), setCanReturnTwice(), setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), setIsNoInline(), and setOnlyReadsMemory().
| bool llvm::CallInst::cannotDuplicate | ( | ) | const [inline] |
Determine if the call cannot be duplicated.
Definition at line 1334 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoDuplicate.
| bool llvm::CallInst::canReturnTwice | ( | ) | const [inline] |
Return true if the call can return twice.
Definition at line 1298 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::ReturnsTwice.
Referenced by llvm::Function::callsFunctionThatReturnsTwice().
| static bool llvm::CallInst::classof | ( | const Instruction * | I | ) | [inline, static] |
Definition at line 1374 of file Instructions.h.
References llvm::Call, and llvm::Instruction::getOpcode().
Referenced by classof().
Methods for support type inquiry through isa, cast, and dyn_cast:
Reimplemented from llvm::Instruction.
Reimplemented in llvm::VACopyInst, llvm::VAEndInst, llvm::VAStartInst, llvm::MemMoveInst, llvm::MemCpyInst, llvm::MemTransferInst, llvm::MemSetInst, llvm::MemIntrinsic, llvm::DbgValueInst, llvm::DbgDeclareInst, llvm::DbgInfoIntrinsic, and llvm::IntrinsicInst.
Definition at line 1377 of file Instructions.h.
References classof().
| CallInst * CallInst::clone_impl | ( | ) | const [protected, virtual] |
Implements llvm::Instruction.
Definition at line 3493 of file Instructions.cpp.
References llvm::User::getNumOperands().
| static CallInst* llvm::CallInst::Create | ( | Value * | Func, |
| ArrayRef< Value * > | Args, | ||
| const Twine & | NameStr = "", |
||
| Instruction * | InsertBefore = 0 |
||
| ) | [inline, static] |
Definition at line 1195 of file Instructions.h.
References llvm::ArrayRef< T >::size().
Referenced by changeToCall(), changeToUnreachable(), llvm::IRBuilder< true, TargetFolder >::CreateCall(), llvm::IRBuilder< true, TargetFolder >::CreateCall2(), llvm::IRBuilder< true, TargetFolder >::CreateCall3(), llvm::IRBuilder< true, TargetFolder >::CreateCall4(), llvm::IRBuilder< true, TargetFolder >::CreateCall5(), createCallHelper(), createFree(), createMalloc(), llvm::DIBuilder::insertDbgValueIntrinsic(), llvm::DIBuilder::insertDeclare(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::JIT::runFunction(), and llvm::InstCombiner::visitFPTrunc().
| static CallInst* llvm::CallInst::Create | ( | Value * | Func, |
| ArrayRef< Value * > | Args, | ||
| const Twine & | NameStr, | ||
| BasicBlock * | InsertAtEnd | ||
| ) | [inline, static] |
Definition at line 1202 of file Instructions.h.
References llvm::ArrayRef< T >::size().
| static CallInst* llvm::CallInst::Create | ( | Value * | F, |
| const Twine & | NameStr = "", |
||
| Instruction * | InsertBefore = 0 |
||
| ) | [inline, static] |
Definition at line 1208 of file Instructions.h.
| static CallInst* llvm::CallInst::Create | ( | Value * | F, |
| const Twine & | NameStr, | ||
| BasicBlock * | InsertAtEnd | ||
| ) | [inline, static] |
Definition at line 1212 of file Instructions.h.
| Instruction * CallInst::CreateFree | ( | Value * | Source, |
| Instruction * | InsertBefore | ||
| ) | [static] |
CreateFree - Generate the IR for a call to the builtin free function.
Definition at line 514 of file Instructions.cpp.
References createFree().
Referenced by LLVMBuildFree(), and PerformHeapAllocSRoA().
| Instruction * CallInst::CreateFree | ( | Value * | Source, |
| BasicBlock * | InsertAtEnd | ||
| ) | [static] |
CreateFree - Generate the IR for a call to the builtin free function. Note: This function does not add the call to the basic block, that is the responsibility of the caller.
Definition at line 521 of file Instructions.cpp.
References createFree().
| Instruction * CallInst::CreateMalloc | ( | Instruction * | InsertBefore, |
| Type * | IntPtrTy, | ||
| Type * | AllocTy, | ||
| Value * | AllocSize, | ||
| Value * | ArraySize = 0, |
||
| Function * | MallocF = 0, |
||
| const Twine & | Name = "" |
||
| ) | [static] |
CreateMalloc - Generate the IR for a call to malloc: 1. Compute the malloc call's argument as the specified type's size, possibly multiplied by the array size if the array size is not constant 1. 2. Call malloc with that argument. 3. Bitcast the result of the malloc call to the specified type.
Definition at line 456 of file Instructions.cpp.
References createMalloc().
Referenced by LLVMBuildArrayMalloc(), LLVMBuildMalloc(), PerformHeapAllocSRoA(), and TryToOptimizeStoreOfMallocToGlobal().
| Instruction * CallInst::CreateMalloc | ( | BasicBlock * | InsertAtEnd, |
| Type * | IntPtrTy, | ||
| Type * | AllocTy, | ||
| Value * | AllocSize, | ||
| Value * | ArraySize = 0, |
||
| Function * | MallocF = 0, |
||
| const Twine & | Name = "" |
||
| ) | [static] |
CreateMalloc - Generate the IR for a call to malloc: 1. Compute the malloc call's argument as the specified type's size, possibly multiplied by the array size if the array size is not constant 1. 2. Call malloc with that argument. 3. Bitcast the result of the malloc call to the specified type. Note: This function does not add the bitcast to the basic block, that is the responsibility of the caller.
Definition at line 473 of file Instructions.cpp.
References createMalloc().
| 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 1306 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::ReadNone.
Referenced by onlyReadsMemory().
| bool llvm::CallInst::doesNotReturn | ( | ) | const [inline] |
Determine if the call cannot return.
Definition at line 1322 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoReturn.
| bool llvm::CallInst::doesNotThrow | ( | ) | const [inline] |
Determine if the call cannot unwind.
Definition at line 1328 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoUnwind.
Referenced by HandleCallsInBlockInlinedThroughInvoke(), and llvm::InstCombiner::visitCallInst().
getArgOperand/setArgOperand - Return/set the i-th call argument.
Definition at line 1253 of file Instructions.h.
References llvm::User::getOperand().
Referenced by llvm::AddCatchInfo(), computeArraySize(), llvm::ComputeUsesVAFloatArgument(), detectLog2OfHalf(), llvm::SimplifyFortifiedLibCalls::fold(), llvm::DbgDeclareInst::getAddress(), llvm::MemIntrinsic::getAlignmentCst(), llvm::MemIntrinsic::getAlignmentType(), llvm::VAStartInst::getArgList(), llvm::VAEndInst::getArgList(), llvm::VACopyInst::getDest(), llvm::MemIntrinsic::getLength(), getLocForWrite(), llvm::DbgValueInst::getOffset(), llvm::MemIntrinsic::getRawDest(), llvm::MemTransferInst::getRawSource(), llvm::VACopyInst::getSrc(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::DbgValueInst::getValue(), llvm::MemSetInst::getValue(), llvm::DbgDeclareInst::getVariable(), llvm::DbgValueInst::getVariable(), llvm::MemIntrinsic::getVolatileCst(), isDynamicConstant(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::IntrinsicLowering::LowerToByteSwap(), PerformHeapAllocSRoA(), ReplaceFPIntrinsicWithCall(), tryToMoveFreeBeforeNullTest(), TryToOptimizeStoreOfMallocToGlobal(), llvm::UpgradeIntrinsicCall(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitFree(), and WriteInstruction().
| const AttributeSet& llvm::CallInst::getAttributes | ( | ) | const [inline] |
getAttributes - Return the parameter attributes for this call.
Definition at line 1268 of file Instructions.h.
Referenced by addAttribute(), HandleCallsInBlockInlinedThroughInvoke(), removeAttribute(), and WriteInstruction().
| Function* llvm::CallInst::getCalledFunction | ( | ) | const [inline] |
getCalledFunction - Return the function called, or null if this is an indirect function invocation.
Definition at line 1354 of file Instructions.h.
References llvm::dyn_cast(), and llvm::User::Op().
Referenced by llvm::IntrinsicInst::classof(), llvm::SimplifyFortifiedLibCalls::fold(), llvm::objcarc::GetInstructionClass(), llvm::IntrinsicInst::getIntrinsicID(), getIntrinsicIDForCall(), hasFnAttr(), llvm::isFreeCall(), llvm::LibCallSimplifierImpl::lookupOptimization(), llvm::IntrinsicLowering::LowerIntrinsicCall(), paramHasAttr(), llvm::FastISel::SelectInstruction(), llvm::UpgradeIntrinsicCall(), llvm::InstCombiner::visitFCmpInst(), and llvm::InstCombiner::visitFPTrunc().
| const Value* llvm::CallInst::getCalledValue | ( | ) | const [inline] |
getCalledValue - Get a pointer to the function that is invoked by this instruction.
Definition at line 1360 of file Instructions.h.
References llvm::User::Op().
Referenced by llvm::ComputeUsesVAFloatArgument(), llvm::ARMTargetLowering::ExpandInlineAsm(), llvm::X86TargetLowering::ExpandInlineAsm(), HandleCallsInBlockInlinedThroughInvoke(), and WriteInstruction().
| Value* llvm::CallInst::getCalledValue | ( | ) | [inline] |
Definition at line 1361 of file Instructions.h.
References llvm::User::Op().
| CallingConv::ID llvm::CallInst::getCallingConv | ( | ) | const [inline] |
getCallingConv/setCallingConv - Get or set the calling convention of this function call.
Definition at line 1258 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by HandleCallsInBlockInlinedThroughInvoke(), and WriteInstruction().
| unsigned llvm::CallInst::getNumArgOperands | ( | ) | const [inline] |
getNumArgOperands - Return the number of call arguments.
Definition at line 1249 of file Instructions.h.
References llvm::User::getNumOperands().
Referenced by llvm::AddCatchInfo(), llvm::ComputeUsesVAFloatArgument(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::UpgradeIntrinsicCall(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFPTrunc(), and WriteInstruction().
Extract the alignment for a call or parameter (0=unknown).
Definition at line 1287 of file Instructions.h.
References llvm::AttributeSet::getParamAlignment().
| bool llvm::CallInst::hasByValArgument | ( | ) | const [inline] |
Determine if any call argument is an aggregate passed by value.
Definition at line 1347 of file Instructions.h.
References llvm::Attribute::ByVal, and llvm::AttributeSet::hasAttrSomewhere().
| bool CallInst::hasFnAttr | ( | Attribute::AttrKind | A | ) | const |
Determine whether this call has the given attribute.
Definition at line 349 of file Instructions.cpp.
References F(), llvm::AttributeSet::FunctionIndex, getCalledFunction(), and llvm::AttributeSet::hasAttribute().
Referenced by cannotDuplicate(), canReturnTwice(), doesNotAccessMemory(), doesNotReturn(), doesNotThrow(), isNoInline(), onlyReadsMemory(), and llvm::LibCallSimplifier::optimizeCall().
| bool llvm::CallInst::hasStructRetAttr | ( | ) | const [inline] |
Determine if the call returns a structure through first pointer argument.
Definition at line 1341 of file Instructions.h.
References paramHasAttr(), and llvm::Attribute::StructRet.
| bool llvm::CallInst::isInlineAsm | ( | ) | const [inline] |
isInlineAsm - Check if this call is an inline asm statement.
Definition at line 1369 of file Instructions.h.
References llvm::User::Op().
| bool llvm::CallInst::isNoInline | ( | ) | const [inline] |
Return true if the call should not be inlined.
Definition at line 1292 of file Instructions.h.
References hasFnAttr(), and llvm::Attribute::NoInline.
| bool llvm::CallInst::isTailCall | ( | ) | const [inline] |
Definition at line 1238 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by WriteInstruction().
| bool llvm::CallInst::onlyReadsMemory | ( | ) | const [inline] |
Determine if the call does not access or only reads memory.
Definition at line 1314 of file Instructions.h.
References doesNotAccessMemory(), hasFnAttr(), and llvm::Attribute::ReadOnly.
| bool CallInst::paramHasAttr | ( | unsigned | i, |
| Attribute::AttrKind | A | ||
| ) | const |
Determine whether the call or the callee has the given attributes.
Definition at line 357 of file Instructions.cpp.
References F(), getCalledFunction(), and llvm::AttributeSet::hasAttribute().
Referenced by hasStructRetAttr().
removeAttribute - removes the attribute from the list of attributes.
Definition at line 340 of file Instructions.cpp.
References getAttributes(), llvm::Value::getContext(), llvm::AttributeSet::removeAttributes(), and setAttributes().
Definition at line 1254 of file Instructions.h.
References llvm::User::setOperand().
Referenced by llvm::InsertProfilingInitCall(), llvm::MemIntrinsic::setAlignment(), llvm::MemIntrinsic::setDest(), llvm::MemIntrinsic::setLength(), llvm::MemTransferInst::setSource(), llvm::MemSetInst::setValue(), llvm::MemIntrinsic::setVolatile(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitFMul().
| void llvm::CallInst::setAttributes | ( | const AttributeSet & | Attrs | ) | [inline] |
setAttributes - Set the parameter attributes for this call.
Definition at line 1272 of file Instructions.h.
Referenced by addAttribute(), llvm::EmitUnaryFloatFnCall(), removeAttribute(), and llvm::InstCombiner::visitFPTrunc().
| void llvm::CallInst::setCalledFunction | ( | Value * | Fn | ) | [inline] |
setCalledFunction - Set the function called.
Definition at line 1364 of file Instructions.h.
References llvm::User::Op().
Referenced by llvm::InstCombiner::visitCallInst().
| void llvm::CallInst::setCallingConv | ( | CallingConv::ID | CC | ) | [inline] |
Definition at line 1261 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by createFree(), createMalloc(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::EmitPutChar(), llvm::EmitPutS(), llvm::EmitStrChr(), llvm::EmitStrCpy(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNCpy(), llvm::EmitStrNLen(), llvm::EmitUnaryFloatFnCall(), and llvm::JIT::runFunction().
| void llvm::CallInst::setCannotDuplicate | ( | ) | [inline] |
Definition at line 1335 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoDuplicate.
| void llvm::CallInst::setCanReturnTwice | ( | ) | [inline] |
Definition at line 1301 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::ReturnsTwice.
| void llvm::CallInst::setDoesNotAccessMemory | ( | ) | [inline] |
Definition at line 1309 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::ReadNone.
| void llvm::CallInst::setDoesNotReturn | ( | ) | [inline] |
Definition at line 1323 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoReturn.
Referenced by INITIALIZE_PASS().
| void llvm::CallInst::setDoesNotThrow | ( | ) | [inline] |
Definition at line 1329 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoUnwind.
Referenced by llvm::InstCombiner::visitCallInst().
| void llvm::CallInst::setIsNoInline | ( | ) | [inline] |
Definition at line 1293 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::NoInline.
| void llvm::CallInst::setOnlyReadsMemory | ( | ) | [inline] |
Definition at line 1317 of file Instructions.h.
References addAttribute(), llvm::AttributeSet::FunctionIndex, and llvm::Attribute::ReadOnly.
Definition at line 1239 of file Instructions.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by createFree(), createMalloc(), and llvm::JIT::runFunction().