Method CreateFunction
CreateFunction(String, IFunctionType)
Gets an existing function with the specified signature to the module or creates a new one if it doesn't exist
Declaration
public IrFunction CreateFunction(string name, IFunctionType signature)
Parameters
public IrFunction CreateFunction(string name, IFunctionType signature)
String | name | Name of the function to add |
IFunctionType | signature | Signature of the function |
Returns
IrFunction | IrFunctionmatching the specified signature and name |
Remarks
If a matching function already exists it is returned, and therefore the returned IrFunction 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(DIScope, String, String, DIFile, UInt32, DebugFunctionType, Boolean, Boolean, UInt32, DebugInfoFlags, Boolean)
Creates a Function definition with Debug information
Declaration
public IrFunction CreateFunction(DIScope scope, string name, string linkageName, DIFile file, uint line, DebugFunctionType signature, bool isLocalToUnit, bool isDefinition, uint scopeLine, DebugInfoFlags debugFlags, bool isOptimized)
Parameters
public IrFunction CreateFunction(DIScope scope, string name, string linkageName, DIFile file, uint line, DebugFunctionType signature, bool isLocalToUnit, bool isDefinition, uint scopeLine, DebugInfoFlags debugFlags, bool isOptimized)
DIScope | scope | Containing scope for the function |
String | name | Name of the function in source language form |
String | linkageName | Mangled linker visible name of the function (may be same as |
DIFile | file | File containing the function definition |
UInt32 | line | Line number of the function definition |
DebugFunctionType | signature | LLVM Function type for the signature of the function |
Boolean | isLocalToUnit | Flag to indicate if this function is local to the compilation unit |
Boolean | isDefinition | Flag to indicate if this is a definition |
UInt32 | scopeLine | First 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 |
DebugInfoFlags | debugFlags | Additional flags describing this function |
Boolean | isOptimized | Flag to indicate if this function is optimized |
Returns
IrFunction | Function described by the arguments |
CreateFunction(String, Boolean, IDebugType<ITypeRef, DIType>, IEnumerable<IDebugType<ITypeRef, DIType>>)
Creates a function
Declaration
public IrFunction CreateFunction(string name, bool isVarArg, IDebugType<ITypeRef, DIType> returnType, IEnumerable<IDebugType<ITypeRef, DIType>> argumentTypes)
Parameters
public IrFunction CreateFunction(string name, bool isVarArg, IDebugType<ITypeRef, DIType> returnType, IEnumerable<IDebugType<ITypeRef, DIType>> argumentTypes)
String | name | Name of the function |
Boolean | isVarArg | Flag indicating if the function supports a variadic argument list |
IDebugType<ITypeRef, DIType> | returnType | Return type of the function |
IEnumerable<IDebugType<ITypeRef, DIType>> | argumentTypes | Arguments for the function |
Returns
IrFunction | 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. |
CreateFunction(String, Boolean, IDebugType<ITypeRef, DIType>, IDebugType<ITypeRef, DIType>[])
Creates a function
Declaration
public IrFunction CreateFunction(string name, bool isVarArg, IDebugType<ITypeRef, DIType> returnType, params IDebugType<ITypeRef, DIType>[] argumentTypes)
Parameters
public IrFunction CreateFunction(string name, bool isVarArg, IDebugType<ITypeRef, DIType> returnType, params IDebugType<ITypeRef, DIType>[] argumentTypes)
String | name | Name of the function |
Boolean | isVarArg | Flag indicating if the function supports a variadic argument list |
IDebugType<ITypeRef, DIType> | returnType | Return type of the function |
IDebugType<ITypeRef, DIType>[] | argumentTypes | Arguments for the function |
Returns
IrFunction | 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. |