compiler/backend/compat

  Source   Edit

This module contains:

  1. routines duplicated from elsewhere and adjusted to work with CgNode instead of PNode
  2. routines for translating PNode to CgNode
  3. utility routines for CgNode of which usage should either be phased out or that should be moved somewhere else

The plan is to eventually replace all usages of the routines part of #1 and #2 with something else (e.g., by running analysis in an earlier phase, lowering earlier, etc.) and then to phase all of them out.

Procs

func callLen(n: CgNode): int {.inline, ...raises: [], tags: [].}
The number of sub-nodes in a call-like node, excluding the trailing jump target description.   Source   Edit
func getCalleeMagic(env: MirEnv; callee: CgNode): TMagic {.inline, ...raises: [],
    tags: [].}
  Source   Edit
func getInt(n: CgNode): Int128 {....raises: [], tags: [].}
  Source   Edit
proc getMagic(env: MirEnv; op: CgNode): TMagic {.inline, ...raises: [], tags: [].}
  Source   Edit
proc getOrdValue(n: CgNode): Int128 {....raises: [], tags: [].}
  Source   Edit
proc isDeepConstExpr(n: CgNode): bool {....raises: [], tags: [].}
  Source   Edit
proc isDiscriminantField(n: CgNode): bool {....raises: [], tags: [].}
  Source   Edit
func isOfBranch(n: CgNode): bool {.inline, ...raises: [], tags: [].}
  Source   Edit
func lastSon(n: CgNode): CgNode {.inline, ...raises: [], tags: [].}
  Source   Edit
proc newSymNode(env: MirEnv; s: PSym): CgNode {.inline, ...raises: [KeyError],
    tags: [].}
  Source   Edit
func numArgs(n: CgNode): int {.inline, ...raises: [], tags: [].}
Returns the number of arguments for a call-like node. The callee is excluded.   Source   Edit
proc pick[T](n: CgNode; forInt, forFloat: T): T
Returns either forInt or forFloat depending on the type of n.   Source   Edit
proc skipConv(n: CgNode): CgNode {.inline, ...raises: [], tags: [].}
  Source   Edit
proc toBitSet(conf: ConfigRef; s: CgNode): TBitSet {.
    ...raises: [Exception, ERecoverableError], tags: [RootEffect].}
Duplicate of toBitSet   Source   Edit
proc translate(t: MirTree; env: MirEnv): CgNode {....raises: [], tags: [].}
Compatibility routine for translating a MIR constant-expression (t) to a CgNode tree. Obsolete once the code generators use the MIR directly.   Source   Edit