LLVM 19.0.0git
Functions
Call Sites and Invocations

Functions in this group apply to instructions that refer to call sites and invocations. More...

Collaboration diagram for Call Sites and Invocations:

Functions

unsigned LLVMGetNumArgOperands (LLVMValueRef Instr)
 Obtain the argument count for a call instruction.
 
void LLVMSetInstructionCallConv (LLVMValueRef Instr, unsigned CC)
 Set the calling convention for a call instruction.
 
unsigned LLVMGetInstructionCallConv (LLVMValueRef Instr)
 Obtain the calling convention for a call instruction.
 
void LLVMSetInstrParamAlignment (LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
 
void LLVMAddCallSiteAttribute (LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
 
unsigned LLVMGetCallSiteAttributeCount (LLVMValueRef C, LLVMAttributeIndex Idx)
 
void LLVMGetCallSiteAttributes (LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
 
LLVMAttributeRef LLVMGetCallSiteEnumAttribute (LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
 
LLVMAttributeRef LLVMGetCallSiteStringAttribute (LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
 
void LLVMRemoveCallSiteEnumAttribute (LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
 
void LLVMRemoveCallSiteStringAttribute (LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
 
LLVMTypeRef LLVMGetCalledFunctionType (LLVMValueRef C)
 Obtain the function type called by this instruction.
 
LLVMValueRef LLVMGetCalledValue (LLVMValueRef Instr)
 Obtain the pointer to the function invoked by this instruction.
 
unsigned LLVMGetNumOperandBundles (LLVMValueRef C)
 Obtain the number of operand bundles attached to this instruction.
 
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex (LLVMValueRef C, unsigned Index)
 Obtain the operand bundle attached to this instruction at the given index.
 
LLVMBool LLVMIsTailCall (LLVMValueRef CallInst)
 Obtain whether a call instruction is a tail call.
 
void LLVMSetTailCall (LLVMValueRef CallInst, LLVMBool IsTailCall)
 Set whether a call instruction is a tail call.
 
LLVMTailCallKind LLVMGetTailCallKind (LLVMValueRef CallInst)
 Obtain a tail call kind of the call instruction.
 
void LLVMSetTailCallKind (LLVMValueRef CallInst, LLVMTailCallKind kind)
 Set the call kind of the call instruction.
 
LLVMBasicBlockRef LLVMGetNormalDest (LLVMValueRef InvokeInst)
 Return the normal destination basic block.
 
LLVMBasicBlockRef LLVMGetUnwindDest (LLVMValueRef InvokeInst)
 Return the unwind destination basic block.
 
void LLVMSetNormalDest (LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
 Set the normal destination basic block.
 
void LLVMSetUnwindDest (LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
 Set the unwind destination basic block.
 
LLVMBasicBlockRef LLVMGetCallBrDefaultDest (LLVMValueRef CallBr)
 Get the default destination of a CallBr instruction.
 
unsigned LLVMGetCallBrNumIndirectDests (LLVMValueRef CallBr)
 Get the number of indirect destinations of a CallBr instruction.
 
LLVMBasicBlockRef LLVMGetCallBrIndirectDest (LLVMValueRef CallBr, unsigned Idx)
 Get the indirect destination of a CallBr instruction at the given index.
 

Detailed Description

Functions in this group apply to instructions that refer to call sites and invocations.

These correspond to C++ types in the llvm::CallInst class tree.

Function Documentation

◆ LLVMAddCallSiteAttribute()

void LLVMAddCallSiteAttribute ( LLVMValueRef  C,
LLVMAttributeIndex  Idx,
LLVMAttributeRef  A 
)

Definition at line 2910 of file Core.cpp.

References A, llvm::CallingConv::C, Idx, and unwrap().

◆ LLVMGetCallBrDefaultDest()

LLVMBasicBlockRef LLVMGetCallBrDefaultDest ( LLVMValueRef  CallBr)

Get the default destination of a CallBr instruction.

See also
llvm::CallBrInst::getDefaultDest()

Definition at line 3018 of file Core.cpp.

References llvm::wrap().

◆ LLVMGetCallBrIndirectDest()

LLVMBasicBlockRef LLVMGetCallBrIndirectDest ( LLVMValueRef  CallBr,
unsigned  Idx 
)

Get the indirect destination of a CallBr instruction at the given index.

See also
llvm::CallBrInst::getIndirectDest()

Definition at line 3026 of file Core.cpp.

References Idx, and llvm::wrap().

◆ LLVMGetCallBrNumIndirectDests()

unsigned LLVMGetCallBrNumIndirectDests ( LLVMValueRef  CallBr)

Get the number of indirect destinations of a CallBr instruction.

See also
llvm::CallBrInst::getNumIndirectDests()

Definition at line 3022 of file Core.cpp.

◆ LLVMGetCalledFunctionType()

LLVMTypeRef LLVMGetCalledFunctionType ( LLVMValueRef  C)

Obtain the function type called by this instruction.

See also
llvm::CallBase::getFunctionType()

Definition at line 2958 of file Core.cpp.

References llvm::wrap().

◆ LLVMGetCalledValue()

LLVMValueRef LLVMGetCalledValue ( LLVMValueRef  Instr)

Obtain the pointer to the function invoked by this instruction.

This expects an LLVMValueRef that corresponds to a llvm::CallInst or llvm::InvokeInst.

See also
llvm::CallInst::getCalledOperand()
llvm::InvokeInst::getCalledOperand()

Definition at line 2954 of file Core.cpp.

References llvm::wrap().

◆ LLVMGetCallSiteAttributeCount()

unsigned LLVMGetCallSiteAttributeCount ( LLVMValueRef  C,
LLVMAttributeIndex  Idx 
)

Definition at line 2915 of file Core.cpp.

References llvm::CallingConv::C, and Idx.

◆ LLVMGetCallSiteAttributes()

void LLVMGetCallSiteAttributes ( LLVMValueRef  C,
LLVMAttributeIndex  Idx,
LLVMAttributeRef Attrs 
)

Definition at line 2922 of file Core.cpp.

References A, llvm::CallingConv::C, Idx, and llvm::wrap().

◆ LLVMGetCallSiteEnumAttribute()

LLVMAttributeRef LLVMGetCallSiteEnumAttribute ( LLVMValueRef  C,
LLVMAttributeIndex  Idx,
unsigned  KindID 
)

Definition at line 2930 of file Core.cpp.

References llvm::CallingConv::C, Idx, and llvm::wrap().

◆ LLVMGetCallSiteStringAttribute()

LLVMAttributeRef LLVMGetCallSiteStringAttribute ( LLVMValueRef  C,
LLVMAttributeIndex  Idx,
const char K,
unsigned  KLen 
)

Definition at line 2937 of file Core.cpp.

References llvm::CallingConv::C, Idx, and llvm::wrap().

◆ LLVMGetInstructionCallConv()

unsigned LLVMGetInstructionCallConv ( LLVMValueRef  Instr)

Obtain the calling convention for a call instruction.

This is the opposite of LLVMSetInstructionCallConv(). Reads its usage.

See also
LLVMSetInstructionCallConv()

Definition at line 2893 of file Core.cpp.

◆ LLVMGetNormalDest()

LLVMBasicBlockRef LLVMGetNormalDest ( LLVMValueRef  InvokeInst)

Return the normal destination basic block.

This only works on llvm::InvokeInst instructions.

See also
llvm::InvokeInst::getNormalDest()

Definition at line 2992 of file Core.cpp.

References llvm::wrap().

◆ LLVMGetNumArgOperands()

unsigned LLVMGetNumArgOperands ( LLVMValueRef  Instr)

Obtain the argument count for a call instruction.

This expects an LLVMValueRef that corresponds to a llvm::CallInst, llvm::InvokeInst, or llvm:FuncletPadInst.

See also
llvm::CallInst::getNumArgOperands()
llvm::InvokeInst::getNumArgOperands()
llvm::FuncletPadInst::getNumArgOperands()

Definition at line 2884 of file Core.cpp.

References unwrap().

◆ LLVMGetNumOperandBundles()

unsigned LLVMGetNumOperandBundles ( LLVMValueRef  C)

Obtain the number of operand bundles attached to this instruction.

This only works on llvm::CallInst and llvm::InvokeInst instructions.

See also
llvm::CallBase::getNumOperandBundles()

Definition at line 2962 of file Core.cpp.

References llvm::CallingConv::C.

◆ LLVMGetOperandBundleAtIndex()

LLVMOperandBundleRef LLVMGetOperandBundleAtIndex ( LLVMValueRef  C,
unsigned  Index 
)

Obtain the operand bundle attached to this instruction at the given index.

Use LLVMDisposeOperandBundle to free the operand bundle.

This only works on llvm::CallInst and llvm::InvokeInst instructions.

Definition at line 2966 of file Core.cpp.

References llvm::CallingConv::C, and llvm::wrap().

◆ LLVMGetTailCallKind()

LLVMTailCallKind LLVMGetTailCallKind ( LLVMValueRef  CallInst)

Obtain a tail call kind of the call instruction.

See also
llvm::CallInst::setTailCallKind()

Definition at line 2982 of file Core.cpp.

◆ LLVMGetUnwindDest()

LLVMBasicBlockRef LLVMGetUnwindDest ( LLVMValueRef  InvokeInst)

Return the unwind destination basic block.

Works on llvm::InvokeInst, llvm::CleanupReturnInst, and llvm::CatchSwitchInst instructions.

See also
llvm::InvokeInst::getUnwindDest()
llvm::CleanupReturnInst::getUnwindDest()
llvm::CatchSwitchInst::getUnwindDest()

Definition at line 2996 of file Core.cpp.

References unwrap(), and llvm::wrap().

◆ LLVMIsTailCall()

LLVMBool LLVMIsTailCall ( LLVMValueRef  CallInst)

Obtain whether a call instruction is a tail call.

This only works on llvm::CallInst instructions.

See also
llvm::CallInst::isTailCall()

Definition at line 2974 of file Core.cpp.

◆ LLVMRemoveCallSiteEnumAttribute()

void LLVMRemoveCallSiteEnumAttribute ( LLVMValueRef  C,
LLVMAttributeIndex  Idx,
unsigned  KindID 
)

Definition at line 2944 of file Core.cpp.

References llvm::CallingConv::C, and Idx.

◆ LLVMRemoveCallSiteStringAttribute()

void LLVMRemoveCallSiteStringAttribute ( LLVMValueRef  C,
LLVMAttributeIndex  Idx,
const char K,
unsigned  KLen 
)

Definition at line 2949 of file Core.cpp.

References llvm::CallingConv::C, and Idx.

◆ LLVMSetInstrParamAlignment()

void LLVMSetInstrParamAlignment ( LLVMValueRef  Instr,
LLVMAttributeIndex  Idx,
unsigned  Align 
)

Definition at line 2902 of file Core.cpp.

References llvm::Attribute::getWithAlignment(), and Idx.

◆ LLVMSetInstructionCallConv()

void LLVMSetInstructionCallConv ( LLVMValueRef  Instr,
unsigned  CC 
)

Set the calling convention for a call instruction.

This expects an LLVMValueRef that corresponds to a llvm::CallInst or llvm::InvokeInst.

See also
llvm::CallInst::setCallingConv()
llvm::InvokeInst::setCallingConv()

Definition at line 2897 of file Core.cpp.

References CC.

◆ LLVMSetNormalDest()

void LLVMSetNormalDest ( LLVMValueRef  InvokeInst,
LLVMBasicBlockRef  B 
)

Set the normal destination basic block.

This only works on llvm::InvokeInst instructions.

See also
llvm::InvokeInst::setNormalDest()

Definition at line 3005 of file Core.cpp.

References B, and unwrap().

◆ LLVMSetTailCall()

void LLVMSetTailCall ( LLVMValueRef  CallInst,
LLVMBool  IsTailCall 
)

Set whether a call instruction is a tail call.

This only works on llvm::CallInst instructions.

See also
llvm::CallInst::setTailCall()

Definition at line 2978 of file Core.cpp.

◆ LLVMSetTailCallKind()

void LLVMSetTailCallKind ( LLVMValueRef  CallInst,
LLVMTailCallKind  kind 
)

Set the call kind of the call instruction.

See also
llvm::CallInst::getTailCallKind()

Definition at line 2986 of file Core.cpp.

◆ LLVMSetUnwindDest()

void LLVMSetUnwindDest ( LLVMValueRef  InvokeInst,
LLVMBasicBlockRef  B 
)

Set the unwind destination basic block.

Works on llvm::InvokeInst, llvm::CleanupReturnInst, and llvm::CatchSwitchInst instructions.

See also
llvm::InvokeInst::setUnwindDest()
llvm::CleanupReturnInst::setUnwindDest()
llvm::CatchSwitchInst::setUnwindDest()

Definition at line 3009 of file Core.cpp.

References B, and unwrap().