LLVM 19.0.0git
Modules | Functions

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

Collaboration diagram for Function values:

Modules

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

Functions

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

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

Add an attribute to a function.

See also
llvm::Function::addAttribute()

Definition at line 2472 of file Core.cpp.

References A, F, Idx, and unwrap().

◆ LLVMAddTargetDependentFunctionAttr()

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 2513 of file Core.cpp.

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

◆ LLVMDeleteFunction()

void LLVMDeleteFunction ( LLVMValueRef  Fn)

Remove a function from its containing module and deletes it.

See also
llvm::Function::eraseFromParent()

Definition at line 2337 of file Core.cpp.

◆ LLVMGetAttributeCountAtIndex()

unsigned LLVMGetAttributeCountAtIndex ( LLVMValueRef  F,
LLVMAttributeIndex  Idx 
)

Definition at line 2477 of file Core.cpp.

References F, and Idx.

◆ LLVMGetAttributesAtIndex()

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

Definition at line 2482 of file Core.cpp.

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

◆ LLVMGetEnumAttributeAtIndex()

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

Definition at line 2489 of file Core.cpp.

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

◆ LLVMGetFunctionCallConv()

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 2418 of file Core.cpp.

◆ LLVMGetGC()

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 2427 of file Core.cpp.

References F.

◆ LLVMGetIntrinsicDeclaration()

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

Create or insert the declaration of an intrinsic.

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

See also
llvm::Intrinsic::getDeclaration()

Definition at line 2364 of file Core.cpp.

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

◆ LLVMGetIntrinsicID()

unsigned LLVMGetIntrinsicID ( LLVMValueRef  Fn)

Obtain the ID number from a function instance.

See also
llvm::Function::getIntrinsicID()

Definition at line 2353 of file Core.cpp.

References F, and unwrap().

◆ LLVMGetPersonalityFn()

LLVMValueRef LLVMGetPersonalityFn ( LLVMValueRef  Fn)

Obtain the personality function attached to the function.

See also
llvm::Function::getPersonalityFn()

Definition at line 2345 of file Core.cpp.

References llvm::wrap().

◆ LLVMGetPrefixData()

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 2440 of file Core.cpp.

References F, and llvm::wrap().

◆ LLVMGetPrologueData()

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 2456 of file Core.cpp.

References F, and llvm::wrap().

◆ LLVMGetStringAttributeAtIndex()

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

Definition at line 2496 of file Core.cpp.

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

◆ LLVMHasPersonalityFn()

LLVMBool LLVMHasPersonalityFn ( LLVMValueRef  Fn)

Check whether the given function has a personality function.

See also
llvm::Function::hasPersonalityFn()

Definition at line 2341 of file Core.cpp.

◆ LLVMHasPrefixData()

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 2445 of file Core.cpp.

References F.

◆ LLVMHasPrologueData()

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 2461 of file Core.cpp.

References F.

◆ LLVMIntrinsicCopyOverloadedName()

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

Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.

Definition at line 2387 of file Core.cpp.

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

◆ LLVMIntrinsicCopyOverloadedName2()

const 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 2398 of file Core.cpp.

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

◆ LLVMIntrinsicGetName()

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

Retrieves the name of an intrinsic.

See also
llvm::Intrinsic::getName()

Definition at line 2373 of file Core.cpp.

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

◆ LLVMIntrinsicGetType()

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 2380 of file Core.cpp.

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

◆ LLVMIntrinsicIsOverloaded()

LLVMBool LLVMIntrinsicIsOverloaded ( unsigned  ID)

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

See also
llvm::Intrinsic::isOverloaded()

Definition at line 2413 of file Core.cpp.

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

◆ LLVMLookupIntrinsicID()

unsigned LLVMLookupIntrinsicID ( const char Name,
size_t  NameLen 
)

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

See also
llvm::Function::lookupIntrinsicID()

Definition at line 2409 of file Core.cpp.

References llvm::Function::lookupIntrinsicID(), and Name.

◆ LLVMRemoveEnumAttributeAtIndex()

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

Definition at line 2503 of file Core.cpp.

References F, and Idx.

◆ LLVMRemoveStringAttributeAtIndex()

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

Definition at line 2508 of file Core.cpp.

References F, and Idx.

◆ LLVMSetFunctionCallConv()

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 2422 of file Core.cpp.

References CC.

◆ LLVMSetGC()

void LLVMSetGC ( LLVMValueRef  Fn,
const char Name 
)

Define the garbage collector to use during code generation.

See also
llvm::Function::setGC()

Definition at line 2432 of file Core.cpp.

References F.

◆ LLVMSetPersonalityFn()

void LLVMSetPersonalityFn ( LLVMValueRef  Fn,
LLVMValueRef  PersonalityFn 
)

Set the personality function attached to the function.

See also
llvm::Function::setPersonalityFn()

Definition at line 2349 of file Core.cpp.

◆ LLVMSetPrefixData()

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 2450 of file Core.cpp.

References F.

◆ LLVMSetPrologueData()

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 2466 of file Core.cpp.

References F.