Class ObjectMarshal<T>
Encodes and/or decodes in-memory objects.
Inherited Members
Namespace: Flame.Llvm
Assembly: Flame.Llvm.dll
Syntax
public abstract class ObjectMarshal<T>
Type Parameters
Name | Description |
---|---|
T | The type of a decoded object. |
Constructors
| Improve this Doc View SourceObjectMarshal(ModuleBuilder, LLVMTargetDataRef)
Creates an object marshal.
Declaration
public ObjectMarshal(ModuleBuilder compiledModule, LLVMTargetDataRef target)
Parameters
Type | Name | Description |
---|---|---|
ModuleBuilder | compiledModule | A compiled LLVM module to inspect for type data layouts. |
LLVMSharp.LLVMTargetDataRef | target | A target data layout to use for determining the precise layout of data types. |
Properties
| Improve this Doc View SourceCompiledModule
Gets the compiled module whose in-memory representation is to be used for encoding objects.
Declaration
public ModuleBuilder CompiledModule { get; }
Property Value
Type | Description |
---|---|
ModuleBuilder | A compiled module. |
MetadataSize
Gets the size of an object's metadata prefix, in bytes.
Declaration
public int MetadataSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The size in bytes of an object's metadata. |
Target
Gets the target data to use for determining field offsets and type sizes.
Declaration
public LLVMTargetDataRef Target { get; }
Property Value
Type | Description |
---|---|
LLVMSharp.LLVMTargetDataRef | LLVM target data. |
Methods
| Improve this Doc View SourceGetFieldOffset(IField)
Gets the offset of a particular field.
Declaration
public int GetFieldOffset(IField field)
Parameters
Type | Name | Description |
---|---|---|
IField | field | A non-static field. |
Returns
Type | Description |
---|---|
System.Int32 | The field's offset in its parent type's layout. |
SizeOf(IType)
Gets a type's encoded size in bytes.
Declaration
public int SizeOf(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | A type. |
Returns
Type | Description |
---|---|
System.Int32 | The type's size in bytes. |
SizeOfWithMetadata(IType, out Int32)
Gets a type's encoded size in bytes.
Declaration
public int SizeOfWithMetadata(IType type, out int metadataSize)
Parameters
Type | Name | Description |
---|---|---|
IType | type | A type. |
System.Int32 | metadataSize | The object's metadata size. |
Returns
Type | Description |
---|---|
System.Int32 | The type's size in bytes, including the size of the metadata. |