diff options
| author | Cody Tapscott <topolarity@tapscott.me> | 2022-11-10 11:58:34 -0700 |
|---|---|---|
| committer | Cody Tapscott <topolarity@tapscott.me> | 2022-11-10 12:22:40 -0700 |
| commit | 8f3880074fb76871d9a4f35d1f72d0304ac5b404 (patch) | |
| tree | f9d2cce5de2ef4080766064f853a9f0793ab5696 /lib/std/build/WriteFileStep.zig | |
| parent | ff699722da1f2df3e521c92cebe71c50910594d3 (diff) | |
| download | zig-8f3880074fb76871d9a4f35d1f72d0304ac5b404.tar.gz zig-8f3880074fb76871d9a4f35d1f72d0304ac5b404.zip | |
stage2: Be more strict about eliding loads
This change makes any of the `*_val` instructions check whether it's
safe to elide copies for by-ref types rather than performing this
elision blindly.
AIR instructions fixed:
- .array_elem_val
- .struct_field_val
- .unwrap_errunion_payload
- .try
- .optional_payload
These now all respect value semantics, as expected.
P.S. Thanks to Andrew for the new way to approach this. Many of the
lines here are from his recommended change, which comes with the
significant advantage that loads are now as small as the intervening
memory access allows.
Co-authored by: Andrew Kelley <andrew@ziglang.org>
Diffstat (limited to 'lib/std/build/WriteFileStep.zig')
0 files changed, 0 insertions, 0 deletions
