diff options
| author | Matthew Lugg <mlugg@mlugg.co.uk> | 2025-01-22 16:48:27 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-22 16:48:27 +0000 |
| commit | 0e815c652d7908be62612bb931c2ee9698dd41da (patch) | |
| tree | 2fdefb0b7575805af532ed4fb60057d1cb3dc206 /src/Zcu/PerThread.zig | |
| parent | 61fe307d0f05eea901577900f4ab2bdaf0ffb35f (diff) | |
| parent | d4b6a53327352dc239644dab0ec2abbe3a1b1be9 (diff) | |
| download | zig-0e815c652d7908be62612bb931c2ee9698dd41da.tar.gz zig-0e815c652d7908be62612bb931c2ee9698dd41da.zip | |
Merge pull request #22572 from jacobly0/new-error-trace
compiler: include error trace in all functions, implement for x86_64 backend
Diffstat (limited to 'src/Zcu/PerThread.zig')
| -rw-r--r-- | src/Zcu/PerThread.zig | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index d7ec7ccea8..c6a16ee00c 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -2596,7 +2596,7 @@ fn analyzeFnBodyInner(pt: Zcu.PerThread, func_index: InternPool.Index) Zcu.SemaE } // reset in case calls to errorable functions are removed. - func.setCallsOrAwaitsErrorableFn(ip, false); + ip.funcSetHasErrorTrace(func_index, fn_ty_info.cc == .auto); // First few indexes of extra are reserved and set at the end. const reserved_count = @typeInfo(Air.ExtraIndex).@"enum".fields.len; @@ -2707,11 +2707,9 @@ fn analyzeFnBodyInner(pt: Zcu.PerThread, func_index: InternPool.Index) Zcu.SemaE func.setBranchHint(ip, sema.branch_hint orelse .none); - // If we don't get an error return trace from a caller, create our own. - if (func.analysisUnordered(ip).calls_or_awaits_errorable_fn and - zcu.comp.config.any_error_tracing and - !sema.fn_ret_ty.isError(zcu)) - { + if (zcu.comp.config.any_error_tracing and func.analysisUnordered(ip).has_error_trace and fn_ty_info.cc != .auto) { + // We're using an error trace, but didn't start out with one from the caller. + // We'll have to create it at the start of the function. sema.setupErrorReturnTrace(&inner_block, last_arg_index) catch |err| switch (err) { error.ComptimeReturn => unreachable, error.ComptimeBreak => unreachable, |
