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.
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
- 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 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 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 of a pointer for the default address space of the target
- PointerSize(uint)
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
- ToLazyEncodedString()
Gets the string representation of this data layout as a LazyEncodedString