Implements the translation from the MIR to the CgNode IR. All code reaching the code generation phase passes through here.
Note:
The tb prefix that's still used in some places is an abbreviation of "translate back"
Note:
The CgNode IR is slated for removal, with the MIR intended to take its place as the code-generator input.
Imports
-
../ast/ast_types, ../ast/ast_idgen, ../ast/ast_query, ../ast/lineinfos, ../ast/types, cgir, ../front/options, ../mir/mirbodies, ../mir/mirenv, ../mir/mirtrees, ../mir/mirtypes, ../mir/sourcemaps, ../modules/modulegraphs, ../utils/containers, ../utils/idioms, ../utils/int128, ../ast/ast, ../sem/semdata
Procs
proc generateIR(graph: ModuleGraph; idgen: IdGenerator; env: var MirEnv; owner: PSym; body: sink MirBody): Body {. ...raises: [Exception, ERecoverableError, KeyError], tags: [RootEffect, ReadDirEffect].}
- Generates the CgNode IR corresponding to the input MIR body, using idgen to provide new IDs when creating symbols. Source Edit