diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-17 11:51:22 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-02-18 19:17:20 -0700 |
| commit | faa44e2e5875036b105d8b7d38ccb2e93757a3c5 (patch) | |
| tree | fc384ad77143ae6a5c7df5a19da4c2ccfef364d9 /src/codegen.zig | |
| parent | 6733e43d87d4fe7b9d89948ebb95a72515c44fee (diff) | |
| download | zig-faa44e2e5875036b105d8b7d38ccb2e93757a3c5.tar.gz zig-faa44e2e5875036b105d8b7d38ccb2e93757a3c5.zip | |
AstGen: rework multi-object for loop
* Allow unbounded looping.
* Lower by incrementing raw pointers for each iterable rather than
incrementing a single index variable. This elides safety checks
without any analysis required thanks to the length assertion and
lowers to decent machine code even in debug builds.
- An "end" value is selected, prioritizing a counter if possible,
falling back to a runtime calculation of ptr+len on a slice input.
* Specialize on the pattern `0..`, avoiding an unnecessary subtraction
instruction being emitted.
* Add the `for_check_lens` ZIR instruction.
Diffstat (limited to 'src/codegen.zig')
0 files changed, 0 insertions, 0 deletions
