Skip to content

Commit e3b79d6

Browse files
antliljaandrewrk
authored andcommitted
LLVM: Move pt field from Object to NavGen
* LLVM: Pass correct tid to emit * Store stack trace type in Zcu * Don't use pt.errorIntType in LLVM backend
1 parent e7b18a7 commit e3b79d6

File tree

5 files changed

+639
-612
lines changed

5 files changed

+639
-612
lines changed

src/Compilation.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,7 @@ fn flush(
30423042
// If there's an output file, it wants to decide where the LLVM object goes!
30433043
const sub_prog_node = comp.link_prog_node.start("LLVM Emit Object", 0);
30443044
defer sub_prog_node.end();
3045-
try llvm_object.emit(.{
3045+
try llvm_object.emit(.{ .zcu = zcu, .tid = tid }, .{
30463046
.pre_ir_path = comp.verbose_llvm_ir,
30473047
.pre_bc_path = comp.verbose_llvm_bc,
30483048

src/Sema.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9916,6 +9916,8 @@ fn finishFunc(
99169916
// lower this fn type.
99179917
const unresolved_stack_trace_ty = try sema.getBuiltinType(block.nodeOffset(.zero), .StackTrace);
99189918
try unresolved_stack_trace_ty.resolveFields(pt);
9919+
9920+
if (zcu.stack_trace_type == .none) zcu.stack_trace_type = unresolved_stack_trace_ty.toIntern();
99199921
}
99209922

99219923
return Air.internedToRef(if (opt_func_index != .none) opt_func_index else func_ty);

src/Zcu.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ free_type_references: std.ArrayListUnmanaged(u32) = .empty,
308308

309309
/// Populated by analysis of `AnalUnit.wrap(.{ .memoized_state = s })`, where `s` depends on the element.
310310
builtin_decl_values: BuiltinDecl.Memoized = .initFill(.none),
311+
stack_trace_type: InternPool.Index = .none,
311312

312313
incremental_debug_state: if (build_options.enable_debug_extensions) IncrementalDebugState else void =
313314
if (build_options.enable_debug_extensions) .init else {},

0 commit comments

Comments
 (0)