| author | |
| committer | |
| log | 041bcbd10943bf78e315466b429ae0acfb5cd97a |
| tree | 5d788b87754c109423145f6a9a3c0bca6e666f75 |
| parent | e3b79d65d808700d6308996a52186dcb3ff48b06 |
3 files changed, 7 insertions(+), 6 deletions(-)
src/Sema.zig+3-3| ... | ... | @@ -9785,6 +9785,8 @@ fn finishFunc( |
| 9785 | 9785 | const zcu = pt.zcu; |
| 9786 | 9786 | const ip = &zcu.intern_pool; |
| 9787 | 9787 | const gpa = sema.gpa; |
| 9788 | const target = zcu.getTarget(); | |
| 9789 | const backend = target_util.zigBackend(target, zcu.comp.config.use_llvm); | |
| 9788 | 9790 | |
| 9789 | 9791 | const return_type: Type = if (opt_func_index == .none or ret_poison) |
| 9790 | 9792 | bare_return_type |
| ... | ... | @@ -9911,13 +9913,11 @@ fn finishFunc( |
| 9911 | 9913 | }), |
| 9912 | 9914 | } |
| 9913 | 9915 | |
| 9914 | if (!is_generic and sema.wantErrorReturnTracing(return_type)) { | |
| 9916 | if (backend == .stage2_llvm and !is_generic and sema.wantErrorReturnTracing(return_type)) { | |
| 9915 | 9917 | // Make sure that StackTrace's fields are resolved so that the backend can |
| 9916 | 9918 | // lower this fn type. |
| 9917 | 9919 | const unresolved_stack_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .StackTrace); |
| 9918 | 9920 | try unresolved_stack_trace_ty.resolveFields(pt); |
| 9919 | ||
| 9920 | if (zcu.stack_trace_type == .none) zcu.stack_trace_type = unresolved_stack_trace_ty.toIntern(); | |
| 9921 | 9921 | } |
| 9922 | 9922 | |
| 9923 | 9923 | return Air.internedToRef(if (opt_func_index != .none) opt_func_index else func_ty); |
src/Zcu.zig-1| ... | ... | @@ -308,7 +308,6 @@ free_type_references: std.ArrayListUnmanaged(u32) = .empty, |
| 308 | 308 | |
| 309 | 309 | /// Populated by analysis of `AnalUnit.wrap(.{ .memoized_state = s })`, where `s` depends on the element. |
| 310 | 310 | builtin_decl_values: BuiltinDecl.Memoized = .initFill(.none), |
| 311 | stack_trace_type: InternPool.Index = .none, | |
| 312 | 311 | |
| 313 | 312 | incremental_debug_state: if (build_options.enable_debug_extensions) IncrementalDebugState else void = |
| 314 | 313 | if (build_options.enable_debug_extensions) .init else {}, |
src/codegen/llvm.zig+4-2| ... | ... | @@ -2596,7 +2596,8 @@ pub const Object = struct { |
| 2596 | 2596 | } |
| 2597 | 2597 | |
| 2598 | 2598 | if (fn_info.cc == .auto and zcu.comp.config.any_error_tracing) { |
| 2599 | const ptr_ty = try pt.ptrType(.{ .child = zcu.stack_trace_type }); | |
| 2599 | const stack_trace_ty = zcu.builtin_decl_values.get(.StackTrace); | |
| 2600 | const ptr_ty = try pt.ptrType(.{ .child = stack_trace_ty }); | |
| 2600 | 2601 | debug_param_types.appendAssumeCapacity(try o.lowerDebugType(pt, ptr_ty)); |
| 2601 | 2602 | } |
| 2602 | 2603 | |
| ... | ... | @@ -3508,7 +3509,8 @@ pub const Object = struct { |
| 3508 | 3509 | } |
| 3509 | 3510 | |
| 3510 | 3511 | if (fn_info.cc == .auto and zcu.comp.config.any_error_tracing) { |
| 3511 | const ptr_ty = try pt.ptrType(.{ .child = zcu.stack_trace_type }); | |
| 3512 | const stack_trace_ty = zcu.builtin_decl_values.get(.StackTrace); | |
| 3513 | const ptr_ty = try pt.ptrType(.{ .child = stack_trace_ty }); | |
| 3512 | 3514 | try llvm_params.append(o.gpa, try o.lowerType(pt, ptr_ty)); |
| 3513 | 3515 | } |
| 3514 | 3516 |