Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git

Functions in this group operate on LLVMValueRef instances that correspond to llvm::Function instances. More...

Collaboration diagram for Function values:

Topics

 Function Parameters
 Functions in this group relate to arguments/parameters on functions.
 IFuncs
 Functions in this group relate to indirect functions.

Functions

LLVM_C_ABI void LLVMDeleteFunction (LLVMValueRef Fn)
 Remove a function from its containing module and deletes it.
LLVM_C_ABI LLVMBool LLVMHasPersonalityFn (LLVMValueRef Fn)
 Check whether the given function has a personality function.
LLVM_C_ABI LLVMValueRef LLVMGetPersonalityFn (LLVMValueRef Fn)
 Obtain the personality function attached to the function.
LLVM_C_ABI void LLVMSetPersonalityFn (LLVMValueRef Fn, LLVMValueRef PersonalityFn)
 Set the personality function attached to the function.
LLVM_C_ABI unsigned LLVMLookupIntrinsicID (const char *Name, size_t NameLen)
 Obtain the intrinsic ID number which matches the given function name.
LLVM_C_ABI unsigned LLVMGetIntrinsicID (LLVMValueRef Fn)
 Obtain the ID number from a function instance.
LLVM_C_ABI LLVMValueRef LLVMGetIntrinsicDeclaration (LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
 Get or insert the declaration of an intrinsic.
LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType (LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
 Retrieves the type of an intrinsic.
LLVM_C_ABI const charLLVMIntrinsicGetName (unsigned ID, size_t *NameLength)
 Retrieves the name of an intrinsic.
LLVM_C_ABI charLLVMIntrinsicCopyOverloadedName (unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
 Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
LLVM_C_ABI charLLVMIntrinsicCopyOverloadedName2 (LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
 Copies the name of an overloaded intrinsic identified by a given list of parameter types.
LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded (unsigned ID)
 Obtain if the intrinsic identified by the given ID is overloaded.
LLVM_C_ABI unsigned LLVMGetFunctionCallConv (LLVMValueRef Fn)
 Obtain the calling function of a function.
LLVM_C_ABI void LLVMSetFunctionCallConv (LLVMValueRef Fn, unsigned CC)
 Set the calling convention of a function.
LLVM_C_ABI const charLLVMGetGC (LLVMValueRef Fn)
 Obtain the name of the garbage collector to use during code generation.
LLVM_C_ABI void LLVMSetGC (LLVMValueRef Fn, const char *Name)
 Define the garbage collector to use during code generation.
LLVM_C_ABI LLVMValueRef LLVMGetPrefixData (LLVMValueRef Fn)
 Gets the prefix data associated with a function.
LLVM_C_ABI LLVMBool LLVMHasPrefixData (LLVMValueRef Fn)
 Check if a given function has prefix data.
LLVM_C_ABI void LLVMSetPrefixData (LLVMValueRef Fn, LLVMValueRef prefixData)
 Sets the prefix data for the function.
LLVM_C_ABI LLVMValueRef LLVMGetPrologueData (LLVMValueRef Fn)
 Gets the prologue data associated with a function.
LLVM_C_ABI LLVMBool LLVMHasPrologueData (LLVMValueRef Fn)
 Check if a given function has prologue data.
LLVM_C_ABI void LLVMSetPrologueData (LLVMValueRef Fn, LLVMValueRef prologueData)
 Sets the prologue data for the function.
LLVM_C_ABI void LLVMAddAttributeAtIndex (LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
 Add an attribute to a function.
LLVM_C_ABI unsigned LLVMGetAttributeCountAtIndex (LLVMValueRef F, LLVMAttributeIndex Idx)
LLVM_C_ABI void LLVMGetAttributesAtIndex (LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
LLVM_C_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex (LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
LLVM_C_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex (LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVM_C_ABI void LLVMRemoveEnumAttributeAtIndex (LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
LLVM_C_ABI void LLVMRemoveStringAttributeAtIndex (LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVM_C_ABI void LLVMAddTargetDependentFunctionAttr (LLVMValueRef Fn, const char *A, const char *V)
 Add a target-dependent attribute to a function.

Detailed Description

Functions in this group operate on LLVMValueRef instances that correspond to llvm::Function instances.

See also
llvm::Function

Function Documentation

◆ LLVMAddAttributeAtIndex()

LLVM_C_ABI void LLVMAddAttributeAtIndex ( LLVMValueRef F,
LLVMAttributeIndex Idx,
LLVMAttributeRef A )

Add an attribute to a function.

See also
llvm::Function::addAttribute()

Definition at line 2580 of file Core.cpp.

References A(), F, and llvm::unwrap().

◆ LLVMAddTargetDependentFunctionAttr()

LLVM_C_ABI void LLVMAddTargetDependentFunctionAttr ( LLVMValueRef Fn,
const char * A,
const char * V )

Add a target-dependent attribute to a function.

See also
llvm::AttrBuilder::addAttribute()

Definition at line 2621 of file Core.cpp.

References A(), llvm::Attribute::get(), and llvm::unwrap().

◆ LLVMDeleteFunction()

LLVM_C_ABI void LLVMDeleteFunction ( LLVMValueRef Fn)

Remove a function from its containing module and deletes it.

See also
llvm::Function::eraseFromParent()

Definition at line 2447 of file Core.cpp.

References llvm::unwrap().

◆ LLVMGetAttributeCountAtIndex()

LLVM_C_ABI unsigned LLVMGetAttributeCountAtIndex ( LLVMValueRef F,
LLVMAttributeIndex Idx )

Definition at line 2585 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMGetAttributesAtIndex()

LLVM_C_ABI void LLVMGetAttributesAtIndex ( LLVMValueRef F,
LLVMAttributeIndex Idx,
LLVMAttributeRef * Attrs )

Definition at line 2590 of file Core.cpp.

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

◆ LLVMGetEnumAttributeAtIndex()

LLVM_C_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex ( LLVMValueRef F,
LLVMAttributeIndex Idx,
unsigned KindID )

Definition at line 2597 of file Core.cpp.

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

◆ LLVMGetFunctionCallConv()

LLVM_C_ABI unsigned LLVMGetFunctionCallConv ( LLVMValueRef Fn)

Obtain the calling function of a function.

The returned value corresponds to the LLVMCallConv enumeration.

See also
llvm::Function::getCallingConv()

Definition at line 2526 of file Core.cpp.

References llvm::unwrap().

◆ LLVMGetGC()

LLVM_C_ABI const char * LLVMGetGC ( LLVMValueRef Fn)

Obtain the name of the garbage collector to use during code generation.

See also
llvm::Function::getGC()

Definition at line 2535 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMGetIntrinsicDeclaration()

LLVM_C_ABI LLVMValueRef LLVMGetIntrinsicDeclaration ( LLVMModuleRef Mod,
unsigned ID,
LLVMTypeRef * ParamTypes,
size_t ParamCount )

Get or insert the declaration of an intrinsic.

For overloaded intrinsics, parameter types must be provided to uniquely identify an overload.

See also
llvm::Intrinsic::getOrInsertDeclaration()

Definition at line 2475 of file Core.cpp.

References llvm::Intrinsic::getOrInsertDeclaration(), llvm_map_to_intrinsic_id(), Mod, llvm::unwrap(), and llvm::wrap().

◆ LLVMGetIntrinsicID()

LLVM_C_ABI unsigned LLVMGetIntrinsicID ( LLVMValueRef Fn)

Obtain the ID number from a function instance.

See also
llvm::Function::getIntrinsicID()

Definition at line 2464 of file Core.cpp.

References llvm::dyn_cast(), F, and llvm::unwrap().

◆ LLVMGetPersonalityFn()

LLVM_C_ABI LLVMValueRef LLVMGetPersonalityFn ( LLVMValueRef Fn)

Obtain the personality function attached to the function.

See also
llvm::Function::getPersonalityFn()

Definition at line 2455 of file Core.cpp.

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

◆ LLVMGetPrefixData()

LLVM_C_ABI LLVMValueRef LLVMGetPrefixData ( LLVMValueRef Fn)

Gets the prefix data associated with a function.

Only valid on functions, and only if LLVMHasPrefixData returns true. See https://llvm.org/docs/LangRef.html#prefix-data

Definition at line 2548 of file Core.cpp.

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

◆ LLVMGetPrologueData()

LLVM_C_ABI LLVMValueRef LLVMGetPrologueData ( LLVMValueRef Fn)

Gets the prologue data associated with a function.

Only valid on functions, and only if LLVMHasPrologueData returns true. See https://llvm.org/docs/LangRef.html#prologue-data

Definition at line 2564 of file Core.cpp.

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

◆ LLVMGetStringAttributeAtIndex()

LLVM_C_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex ( LLVMValueRef F,
LLVMAttributeIndex Idx,
const char * K,
unsigned KLen )

Definition at line 2604 of file Core.cpp.

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

◆ LLVMHasPersonalityFn()

LLVM_C_ABI LLVMBool LLVMHasPersonalityFn ( LLVMValueRef Fn)

Check whether the given function has a personality function.

See also
llvm::Function::hasPersonalityFn()

Definition at line 2451 of file Core.cpp.

References llvm::unwrap().

◆ LLVMHasPrefixData()

LLVM_C_ABI LLVMBool LLVMHasPrefixData ( LLVMValueRef Fn)

Check if a given function has prefix data.

Only valid on functions. See https://llvm.org/docs/LangRef.html#prefix-data

Definition at line 2553 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMHasPrologueData()

LLVM_C_ABI LLVMBool LLVMHasPrologueData ( LLVMValueRef Fn)

Check if a given function has prologue data.

Only valid on functions. See https://llvm.org/docs/LangRef.html#prologue-data

Definition at line 2569 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMIntrinsicCopyOverloadedName()

LLVM_C_ABI char * LLVMIntrinsicCopyOverloadedName ( unsigned ID,
LLVMTypeRef * ParamTypes,
size_t ParamCount,
size_t * NameLength )

Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.

Definition at line 2498 of file Core.cpp.

References llvm::Intrinsic::getNameNoUnnamedTypes(), llvm_map_to_intrinsic_id(), and llvm::unwrap().

◆ LLVMIntrinsicCopyOverloadedName2()

LLVM_C_ABI char * LLVMIntrinsicCopyOverloadedName2 ( LLVMModuleRef Mod,
unsigned ID,
LLVMTypeRef * ParamTypes,
size_t ParamCount,
size_t * NameLength )

Copies the name of an overloaded intrinsic identified by a given list of parameter types.

Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the returned string.

This version also supports unnamed types.

See also
llvm::Intrinsic::getName()

Definition at line 2507 of file Core.cpp.

References llvm::Intrinsic::getName(), llvm_map_to_intrinsic_id(), Mod, and llvm::unwrap().

◆ LLVMIntrinsicGetName()

LLVM_C_ABI const char * LLVMIntrinsicGetName ( unsigned ID,
size_t * NameLength )

Retrieves the name of an intrinsic.

See also
llvm::Intrinsic::getName()

Definition at line 2484 of file Core.cpp.

References llvm::Intrinsic::getName(), and llvm_map_to_intrinsic_id().

◆ LLVMIntrinsicGetType()

LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType ( LLVMContextRef Ctx,
unsigned ID,
LLVMTypeRef * ParamTypes,
size_t ParamCount )

Retrieves the type of an intrinsic.

For overloaded intrinsics, parameter types must be provided to uniquely identify an overload.

See also
llvm::Intrinsic::getType()

Definition at line 2491 of file Core.cpp.

References llvm::Intrinsic::getType(), llvm_map_to_intrinsic_id(), llvm::unwrap(), and llvm::wrap().

◆ LLVMIntrinsicIsOverloaded()

LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded ( unsigned ID)

Obtain if the intrinsic identified by the given ID is overloaded.

See also
llvm::Intrinsic::isOverloaded()

Definition at line 2521 of file Core.cpp.

References llvm::Intrinsic::isOverloaded(), and llvm_map_to_intrinsic_id().

◆ LLVMLookupIntrinsicID()

LLVM_C_ABI unsigned LLVMLookupIntrinsicID ( const char * Name,
size_t NameLen )

Obtain the intrinsic ID number which matches the given function name.

See also
llvm::Intrinsic::lookupIntrinsicID()

Definition at line 2517 of file Core.cpp.

References llvm::Intrinsic::lookupIntrinsicID().

◆ LLVMRemoveEnumAttributeAtIndex()

LLVM_C_ABI void LLVMRemoveEnumAttributeAtIndex ( LLVMValueRef F,
LLVMAttributeIndex Idx,
unsigned KindID )

Definition at line 2611 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMRemoveStringAttributeAtIndex()

LLVM_C_ABI void LLVMRemoveStringAttributeAtIndex ( LLVMValueRef F,
LLVMAttributeIndex Idx,
const char * K,
unsigned KLen )

Definition at line 2616 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMSetFunctionCallConv()

LLVM_C_ABI void LLVMSetFunctionCallConv ( LLVMValueRef Fn,
unsigned CC )

Set the calling convention of a function.

See also
llvm::Function::setCallingConv()
Parameters
FnFunction to operate on
CCLLVMCallConv to set calling convention to

Definition at line 2530 of file Core.cpp.

References llvm::unwrap().

◆ LLVMSetGC()

LLVM_C_ABI void LLVMSetGC ( LLVMValueRef Fn,
const char * Name )

Define the garbage collector to use during code generation.

See also
llvm::Function::setGC()

Definition at line 2540 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMSetPersonalityFn()

LLVM_C_ABI void LLVMSetPersonalityFn ( LLVMValueRef Fn,
LLVMValueRef PersonalityFn )

Set the personality function attached to the function.

See also
llvm::Function::setPersonalityFn()

Definition at line 2459 of file Core.cpp.

References llvm::unwrap().

◆ LLVMSetPrefixData()

LLVM_C_ABI void LLVMSetPrefixData ( LLVMValueRef Fn,
LLVMValueRef prefixData )

Sets the prefix data for the function.

Only valid on functions. See https://llvm.org/docs/LangRef.html#prefix-data

Definition at line 2558 of file Core.cpp.

References F, and llvm::unwrap().

◆ LLVMSetPrologueData()

LLVM_C_ABI void LLVMSetPrologueData ( LLVMValueRef Fn,
LLVMValueRef prologueData )

Sets the prologue data for the function.

Only valid on functions. See https://llvm.org/docs/LangRef.html#prologue-data

Definition at line 2574 of file Core.cpp.

References F, and llvm::unwrap().