aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorMatthew Borkowski <matthew.h.borkowski@gmail.com>2021-10-20 02:34:51 -0400
committerMatthew Borkowski <matthew.h.borkowski@gmail.com>2021-11-01 05:42:32 -0400
commit65c27e8e6612b8d649ae1481c27c8e7f0e78ad32 (patch)
treef084ec93c06b48fa7380920c10751bf3e5644d4c /src/codegen.zig
parent92d2aa1b48c2171d58eec51552ca30d1cc0fe206 (diff)
downloadzig-65c27e8e6612b8d649ae1481c27c8e7f0e78ad32.tar.gz
zig-65c27e8e6612b8d649ae1481c27c8e7f0e78ad32.zip
astgen.zig: delay adding closure_capture instructions to preserve GenZir nesting. Only containers create Namespaces, so the declaring_gz is always the GenZir passed to containerDecl, and containerDecl will always add exactly one instruction (an extended *_decl) to that GenZir. Thus, closure_capture instructions are always lined up immediately after a container decl instruction, so rather than adding them at the point of first mention, where we're nested arbitrarily deep, simply walk through the Namespace captures hash map at the end of each containerDecl branch and add them then.
Diffstat (limited to 'src/codegen.zig')
0 files changed, 0 insertions, 0 deletions