Commit b6726913d3

mlugg <mlugg@mlugg.co.uk>
2025-01-24 23:16:50
Zcu: remove `null_stack_trace`
The new simplifications to the panic handler have eliminated the need for this piece of memoized state.
1 parent 3232e59
Changed files (2)
src/Sema.zig
@@ -38539,21 +38539,6 @@ pub fn analyzeMemoizedState(sema: *Sema, block: *Block, simple_src: LazySrcLoc,
         }
     }
 
-    if (stage == .panic) {
-        // We use `getBuiltinType` because this is from an earlier stage.
-        const stack_trace_ty = try sema.getBuiltinType(simple_src, .StackTrace);
-        const ptr_stack_trace_ty = try pt.singleMutPtrType(stack_trace_ty);
-        const opt_ptr_stack_trace_ty = try pt.optionalType(ptr_stack_trace_ty.toIntern());
-        const null_stack_trace = try pt.intern(.{ .opt = .{
-            .ty = opt_ptr_stack_trace_ty.toIntern(),
-            .val = .none,
-        } });
-        if (null_stack_trace != zcu.null_stack_trace) {
-            zcu.null_stack_trace = null_stack_trace;
-            any_changed = true;
-        }
-    }
-
     return any_changed;
 }
 
src/Zcu.zig
@@ -219,8 +219,6 @@ free_type_references: std.ArrayListUnmanaged(u32) = .empty,
 
 /// Populated by analysis of `AnalUnit.wrap(.{ .memoized_state = s })`, where `s` depends on the element.
 builtin_decl_values: BuiltinDecl.Memoized = .initFill(.none),
-/// Populated by analysis of `AnalUnit.wrap(.{ .memoized_state = .panic })`.
-null_stack_trace: InternPool.Index = .none,
 
 generation: u32 = 0,