Method CreateFunction
CreateFunction(LazyEncodedString, IFunctionType)
Gets an existing function with the specified signature in the module or creates a new one if it doesn't exist
Function CreateFunction(LazyEncodedString name, IFunctionType signature)
Parameters
name
LazyEncodedStringName of the function to add
signature
IFunctionTypeSignature of the function
Returns
Remarks
If a matching function already exists it is returned, and therefore the returned Function may have a body and additional attributes. If a function of the same name exists with a different signature an exception is thrown as LLVM does not perform any function overloading.
CreateFunction(IDIBuilder, DIScope?, LazyEncodedString, LazyEncodedString?, DIFile?, uint, DebugFunctionType, bool, bool, uint, DebugInfoFlags, bool)
Creates a Function definition with Debug information
Function CreateFunction(IDIBuilder diBuilder, DIScope? scope, LazyEncodedString name, LazyEncodedString? linkageName, DIFile? file, uint line, DebugFunctionType signature, bool isLocalToUnit, bool isDefinition, uint scopeLine, DebugInfoFlags debugFlags, bool isOptimized)
Parameters
diBuilder
IDIBuilderThe debug info builder to use to create the function (must be associated with this module)
scope
DIScopeContaining scope for the function
name
LazyEncodedStringName of the function in source language form
linkageName
LazyEncodedStringMangled linker visible name of the function (may be same as
name
if mangling not required by source languagefile
DIFileFile containing the function definition
line
uintLine number of the function definition
signature
DebugFunctionTypeLLVM Function type for the signature of the function
isLocalToUnit
boolFlag to indicate if this function is local to the compilation unit
isDefinition
boolFlag to indicate if this is a definition
scopeLine
uintFirst line of the function's outermost scope, this may not be the same as the first line of the function definition due to source formatting
debugFlags
DebugInfoFlagsAdditional flags describing this function
isOptimized
boolFlag to indicate if this function is optimized
Returns
- Function
Function described by the arguments
CreateFunction(IDIBuilder, LazyEncodedString, bool, IDebugType<ITypeRef, DIType>, params IEnumerable<IDebugType<ITypeRef, DIType>>)
Creates a function
Function CreateFunction(IDIBuilder diBuilder, LazyEncodedString name, bool isVarArg, IDebugType<ITypeRef, DIType> returnType, params IEnumerable<IDebugType<ITypeRef, DIType>> argumentTypes)
Parameters
diBuilder
IDIBuilderDIBuilder for creation of debug information
name
LazyEncodedStringName of the function
isVarArg
boolFlag indicating if the function supports a variadic argument list
returnType
IDebugType<ITypeRef, DIType>Return type of the function
argumentTypes
IEnumerable<IDebugType<ITypeRef, DIType>>Arguments for the function
Returns
- Function
Function, matching the signature specified. This may be a previously declared or defined function or a new function if none matching the name and signature is already present.