mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 05:20:34 +00:00
parent
d78532f462
commit
3d18c8c130
@ -4508,6 +4508,7 @@ fn zirCompileLog(
|
||||
const arg = try sema.resolveInst(arg_ref);
|
||||
const arg_ty = sema.typeOf(arg);
|
||||
if (try sema.resolveMaybeUndefVal(block, src, arg)) |val| {
|
||||
try sema.resolveLazyValue(block, src, val);
|
||||
try writer.print("@as({}, {})", .{
|
||||
arg_ty.fmt(sema.mod), val.fmtValue(arg_ty, sema.mod),
|
||||
});
|
||||
@ -25440,6 +25441,10 @@ fn resolveLazyValue(
|
||||
const ty = val.castTag(.lazy_align).?.data;
|
||||
return sema.resolveTypeLayout(block, src, ty);
|
||||
},
|
||||
.lazy_size => {
|
||||
const ty = val.castTag(.lazy_size).?.data;
|
||||
return sema.resolveTypeLayout(block, src, ty);
|
||||
},
|
||||
else => return,
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,9 +6,14 @@ fn bar(a: i32, b: []const u8) void {
|
||||
@compileLog("a", a, "b", b);
|
||||
@compileLog("end",);
|
||||
}
|
||||
export fn baz() void {
|
||||
const S = struct { a: u32 };
|
||||
@compileLog(@sizeOf(S));
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=llvm
|
||||
// target=native
|
||||
//
|
||||
// :5:5: error: found compile log statement
|
||||
// :11:5: note: also here
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user