Interface IDataLayout
Provides access to LLVM target data layout information
public interface IDataLayout
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 |
Properties
- Endianness
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 (in bytes) of the given type
- BitOffsetOfElement(IStructType, uint)
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 (in bytes) for a given type
- ElementAtOffset(IStructType, ulong)
Gets the element index for a specific offset in a given structure
- IntPtrType(IContext)
Retrieves an LLVM integer type with the same bit width as a pointer for the default address space of the target
- IntPtrType(IContext, uint)
Retrieves an LLVM integer type with the same bit width as a pointer for the given address space of the target
- OffsetOfElement(IStructType, uint)
Gets the offset of an element in a structure
- PointerSize()
Gets the size (in bytes) of a pointer for the default address space of the target
- PointerSize(uint)
Retrieves the size (in bytes) of a pointer for a given address space of the target
- PreferredAlignmentOf(ITypeRef)
Gets the preferred alignment (in bytes) for an LLVM type
- PreferredAlignmentOf(Value)
Gets the preferred alignment (in bytes) 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
- ToLazyEncodedString()
Gets the string representation of this data layout as a Ubiquity.NET.InteropHelpers.LazyEncodedString