Table of Contents

Class DebugFunctionType

Namespace
Ubiquity.NET.Llvm.DebugInfo
Assembly
Ubiquity.NET.Llvm.dll

This class provides debug information binding for an IFunctionType and a DISubroutineType

public class DebugFunctionType : DebugType<IFunctionType, DISubroutineType>, IDebugType<IFunctionType, DISubroutineType>, IEquatable<ITypeHandleOwner>, IFunctionType, ITypeRef, IEquatable<ITypeRef>
Inheritance
DebugFunctionType
Implements
IEquatable<ITypeHandleOwner>
Inherited Members
Extension Methods

Remarks

Function signatures are unnamed interned types in LLVM. While there is usually a one to one mapping between an LLVM function signature type and the source language debug signature type - that isn't always true. In particular, when passing data by value. In cases where the address of a by value structure is needed, a common pattern is to use a pointer to the structure in the signature, then perform an Alloca + memcpy. The actual approach taken depends on the calling conventions of the target. In these cases you get an LLVM signature that doesn't match the source and could actually match another source function where a pointer to the structure is actually used in the source.

For example, the following two C language functions might use the same LLVM signature:

void foo(struct bar)
void foo2(struct bar*)

Implementing both of those might be done in LLVM with a single signature:

void (%struct.bar*)

This class is designed to provide mapping between the debug signature type and the underlying LLVM type

note

It is important to keep in mind that signatures are only concerned with types. That is, they do not include names of parameters. Parameter information is provided by CreateArgument(DIScope?, LazyEncodedString, DIFile?, uint, DIType?, bool, DebugInfoFlags, ushort) and [DIBuilder.InsertDeclare](xref:Ubiquity.NET.Llvm.DebugInfo.DIBuilder.InsertDeclare*)

Constructors

DebugFunctionType(IFunctionType, IDIBuilder, DebugInfoFlags, IDebugType<ITypeRef, DIType>, params IEnumerable<IDebugType<ITypeRef, DIType>>)

Initializes a new instance of the DebugFunctionType class.

Properties

IsVarArg

Gets a value indicating whether this signature is for a variadic function

ParameterTypes

Gets the types of the parameters for the function

ReturnType

Gets the return type of the function

See Also