diff --git a/src/Sema.zig b/src/Sema.zig index e3db1cfee006..418e9441f01c 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -16883,10 +16883,7 @@ fn zirBuiltinSrc( // fn_name: [:0]const u8, func_name_val, // line: u32, - try mod.intern(.{ .runtime_value = .{ - .ty = .u32_type, - .val = (try mod.intValue(Type.u32, extra.line + 1)).toIntern(), - } }), + (try mod.intValue(Type.u32, extra.line + 1)).toIntern(), // column: u32, (try mod.intValue(Type.u32, extra.column + 1)).toIntern(), }; diff --git a/src/tracy.zig b/src/tracy.zig index 10f24100912b..08774f9bd35e 100644 --- a/src/tracy.zig +++ b/src/tracy.zig @@ -63,44 +63,40 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct { pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx { if (!enable) return .{}; - if (enable_callstack) { - return ___tracy_emit_zone_begin_callstack(&.{ + const global = struct { + const loc: ___tracy_source_location_data = .{ .name = null, .function = src.fn_name.ptr, .file = src.file.ptr, .line = src.line, .color = 0, - }, callstack_depth, 1); + }; + }; + + if (enable_callstack) { + return ___tracy_emit_zone_begin_callstack(&global.loc, callstack_depth, 1); } else { - return ___tracy_emit_zone_begin(&.{ - .name = null, - .function = src.fn_name.ptr, - .file = src.file.ptr, - .line = src.line, - .color = 0, - }, 1); + return ___tracy_emit_zone_begin(&global.loc, 1); } } pub inline fn traceNamed(comptime src: std.builtin.SourceLocation, comptime name: [:0]const u8) Ctx { if (!enable) return .{}; - if (enable_callstack) { - return ___tracy_emit_zone_begin_callstack(&.{ + const global = struct { + const loc: ___tracy_source_location_data = .{ .name = name.ptr, .function = src.fn_name.ptr, .file = src.file.ptr, .line = src.line, .color = 0, - }, callstack_depth, 1); + }; + }; + + if (enable_callstack) { + return ___tracy_emit_zone_begin_callstack(&global.loc, callstack_depth, 1); } else { - return ___tracy_emit_zone_begin(&.{ - .name = name.ptr, - .function = src.fn_name.ptr, - .file = src.file.ptr, - .line = src.line, - .color = 0, - }, 1); + return ___tracy_emit_zone_begin(&global.loc, 1); } } diff --git a/test/cases/compile_errors/src_fields_runtime.zig b/test/cases/compile_errors/src_fields_runtime.zig deleted file mode 100644 index a9828311233a..000000000000 --- a/test/cases/compile_errors/src_fields_runtime.zig +++ /dev/null @@ -1,17 +0,0 @@ -pub export fn entry1() void { - const s = @src(); - comptime var a: []const u8 = s.file; - comptime var b: []const u8 = s.fn_name; - comptime var c: u32 = s.column; - comptime var d: u32 = s.line; - _ = a; - _ = b; - _ = c; - _ = d; -} - -// error -// backend=stage2 -// target=native -// -// :6:28: error: cannot store runtime value in compile time variable