zig icon indicating copy to clipboard operation
zig copied to clipboard

Sema: resolveStructLayout when use packed struct child type

Open kkHAIKE opened this issue 1 year ago • 5 comments

Closes https://github.com/ziglang/zig/issues/13159

This may not be the best solution..

kkHAIKE avatar Oct 16 '22 09:10 kkHAIKE

IMO the bug is the LLVM backend not handling the possibility of namespace like packed structs.

Vexu avatar Oct 17 '22 10:10 Vexu

IMO the bug is the LLVM backend not handling the possibility of namespace like packed structs.

Indeed it is. another way, call resolveStructLayout in LLVM.dbg_var instead of Sema.field_val ?

kkHAIKE avatar Oct 17 '22 11:10 kkHAIKE

another way, call resolveStructLayout in LLVM.dbg_var instead of Sema.field_val ?

Backends should not do any semantic analysis.

Vexu avatar Oct 17 '22 11:10 Vexu

LLVM.dbg_var ignore backing_int_ty field if it is no_return ? (packed struct default init value)

kkHAIKE avatar Oct 17 '22 11:10 kkHAIKE

lowerDebugTypeImpl for packed structs should check haveFieldTypes as is done for regular structs a few lines down.

Vexu avatar Oct 17 '22 11:10 Vexu