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
public Function CreateFunction(LazyEncodedString name, IFunctionType signature)
Parameters
nameLazyEncodedStringName of the function to add
signatureIFunctionTypeSignature 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
public 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
diBuilderIDIBuilderThe debug info builder to use to create the function (must be associated with this module)
scopeDIScopeContaining scope for the function
nameLazyEncodedStringName of the function in source language form
linkageNameLazyEncodedStringMangled linker visible name of the function (may be same as
nameif mangling not required by source languagefileDIFileFile containing the function definition
lineuintLine number of the function definition
signatureDebugFunctionTypeLLVM Function type for the signature of the function
isLocalToUnitboolFlag to indicate if this function is local to the compilation unit
isDefinitionboolFlag to indicate if this is a definition
scopeLineuintFirst 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
debugFlagsDebugInfoFlagsAdditional flags describing this function
isOptimizedboolFlag 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
public Function CreateFunction(IDIBuilder diBuilder, LazyEncodedString name, bool isVarArg, IDebugType<ITypeRef, DIType> returnType, params IEnumerable<IDebugType<ITypeRef, DIType>> argumentTypes)
Parameters
diBuilderIDIBuilderDIBuilder for creation of debug information
nameLazyEncodedStringName of the function
isVarArgboolFlag indicating if the function supports a variadic argument list
returnTypeIDebugType<ITypeRef, DIType>Return type of the function
argumentTypesIEnumerable<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.