compiler/vm/vmtypes

  Source   Edit

This module contains various functions for querying information about VmTypes and working with them in general.

Types

VmTypeRel = enum
  vtrUnrelated, vtrSame, vtrSub, vtrSuper
  Source   Edit

Procs

func alignedSize(t: PVmType): uint {.inline, ...raises: [], tags: [].}
  Source   Edit
func elemType(typ: PVmType): PVmType {....raises: [], tags: [].}
  Source   Edit
func findDiscrBranchEntry(t: PVmType; idx: FieldIndex): uint32 {....raises: [],
    tags: [].}
Returns the branch-entry index for the discriminator with the given field index   Source   Edit
func getFieldAndOwner(t: PVmType; p: FieldPosition): (PVmType, FieldIndex) {.
    inline, ...raises: [], tags: [].}
  Source   Edit
func getTypeRel(a, b: PVmType): VmTypeRel {....raises: [], tags: [].}
Computes the relation between a and b, namely, whether a a super, sub, same or unrelated type to b. The rules from the language manual are used   Source   Edit
func objTypeRel(a, b: PVmType; swapped: bool): VmTypeRel {....raises: [], tags: [].}
  Source   Edit
func toFieldIndex(t: PVmType; p: FieldPosition): FieldIndex {....raises: [],
    tags: [].}
  Source   Edit
func toFieldPos(t: PVmType; i: FieldIndex): FieldPosition {....raises: [], tags: [].}
  Source   Edit
func totalFieldCount(t: PVmType): int {....raises: [], tags: [].}
The total number of 'real' fields (this excludes the base fields)   Source   Edit