aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-10-21 12:42:27 -0700
committerCody Tapscott <topolarity@tapscott.me>2022-10-21 12:46:46 -0700
commitc36a2c27a51039d486f4149018154687a300d1eb (patch)
tree00e8eb7535b6f1e26b69ee237d7a82ee6102cc50 /src/Module.zig
parent74b9cbd8950f4752c5c80925a8baa5fb2492d99f (diff)
downloadzig-c36a2c27a51039d486f4149018154687a300d1eb.tar.gz
zig-c36a2c27a51039d486f4149018154687a300d1eb.zip
Change how `Block` propagates (error return) trace index
Instead of adding 3 fields to every `Block`, this adds just one. The function-level information is saved in the `Sema` struct instead, which is created/copied more rarely.
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Module.zig b/src/Module.zig
index c23014f92a..4f150b0148 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -5635,10 +5635,9 @@ pub fn analyzeFnBody(mod: *Module, func: *Fn, arena: Allocator) SemaError!Air {
// Save the error trace as our first action in the function.
// If this is unnecessary after all, Liveness will clean it up for us.
- const err_ret_trace_index = try sema.analyzeSaveErrRetIndex(&inner_block);
- inner_block.error_return_trace_index = err_ret_trace_index;
- inner_block.error_return_trace_index_on_block_entry = err_ret_trace_index;
- inner_block.error_return_trace_index_on_function_entry = err_ret_trace_index;
+ const error_return_trace_index = try sema.analyzeSaveErrRetIndex(&inner_block);
+ sema.error_return_trace_index_on_fn_entry = error_return_trace_index;
+ inner_block.error_return_trace_index = error_return_trace_index;
sema.analyzeBody(&inner_block, fn_info.body) catch |err| switch (err) {
// TODO make these unreachable instead of @panic