Class DataLayout
Provides access to LLVM target data layout information
Inheritance
Namespace: Llvm.NET
Assembly: Llvm.NET.dll
Syntax
public sealed class DataLayout
Remarks
There is a distinction between various sizes and alignment for a given type that are target dependent.
The following table illustrates the differences in sizes and their meaning for a sample set of types.
Type | SizeInBits | StoreSizeInBits | AbiSizeInBits |
---|---|---|---|
i1 | 1 | 8 | 8 |
i8 | 8 | 8 | 8 |
i19 | 19 | 24 | 32 |
i32 | 32 | 32 | 32 |
i10 | 100 | 104 | 128 |
i128 | 128 | 128 | 128 |
Float | 32 | 32 | 32 |
Double | 64 | 64 | 64 |
X86_FP80 | 80 | 80 | 96 |
note
The allocation size depends on the alignment, and thus on the target. The values in the example table are for x86-32-linux.
Property | Definition |
---|---|
SizeInBits | Minimum number of bits needed to represent the full range of values for the type |
StoreSizeInBits | Minimum number of bits needed to actually store a single value of the type |
AbiSizeInBits | Total number of bits used to store a value in a sequence, including any alignment padding |
The allocation size determines the total size of each entry in a sequence so that the "next" element is computed by adding the size to the start address of the current element.
Properties
Endianess | Gets the byte ordering for this target |
Methods
AbiAlignmentOf(ITypeRef) | Retrieves the ABI specified alignment, in bytes, for a specified type |
AbiBitAlignmentOf(ITypeRef) | Gets the ABI alignment of the type in bits |
AbiSizeOf(ITypeRef) | Retrieves the ABI specified size of the given type |
BitOffsetOfElement(IStructType, UInt32) | Gets the offset of a structure element in bits |
BitSizeOf(ITypeRef) | Returns the number of bits necessary to hold the specified type. |
ByteSizeOf(ITypeRef) | Gets the byte size of a type |
CallFrameAlignmentOf(ITypeRef) | Retrieves the call frame alignment for a given type |
ElementAtOffset(IStructType, UInt64) | Gets the element index for a specific offset in a given structure |
IntPtrType(Context) | Retrieves an LLVM integer type with the same bit width as a pointer for the default address space of the target |
IntPtrType(Context, UInt32) | Retrieves an LLVM integer type with the same bit width as a pointer for the given address space of the target |
OffsetOfElement(IStructType, UInt32) | Gets the offset of an element in a structure |
PointerSize() | Gets the size of a pointer for the default address space of the target |
PointerSize(UInt32) | Retrieves the size of a pointer for a given address space of the target |
PreferredAlignmentOf(ITypeRef) | Gets the preferred alignment for an LLVM type |
PreferredAlignmentOf(Value) | Gets the preferred alignment for a Value |
PreferredBitAlignmentOf(ITypeRef) | Gets the preferred alignment of the type in bits |
StoreSizeOf(ITypeRef) | Retrieves the number of bits required to store a value of the given type |
ToString() |