diff options
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 763dde170b..af9dcacf48 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -2137,7 +2137,8 @@ pub const Object = struct { break :blk fwd_decl; }; - if (!ty.hasRuntimeBitsIgnoreComptime()) { + const union_obj = ty.cast(Type.Payload.Union).?.data; + if (!union_obj.haveFieldTypes() or !ty.hasRuntimeBitsIgnoreComptime()) { const union_di_ty = try o.makeEmptyNamespaceDIType(owner_decl_index); dib.replaceTemporary(fwd_decl, union_di_ty); // The recursive call to `lowerDebugType` via `makeEmptyNamespaceDIType` @@ -2147,7 +2148,6 @@ pub const Object = struct { } const layout = ty.unionGetLayout(target); - const union_obj = ty.cast(Type.Payload.Union).?.data; if (layout.payload_size == 0) { const tag_di_ty = try o.lowerDebugType(union_obj.tag_ty, .full); |
