diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-06-09 19:23:36 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-06-09 19:23:36 -0700 |
| commit | 32c90cb5539c3b340ae1b0b13d2b1521ebb6b1b0 (patch) | |
| tree | 149e21f6afdce496a95d29d97a1d6e3ccd6d0f4d /src/codegen/llvm.zig | |
| parent | f1cff4fa4a28d42ac9055f94ee9a8f7fd2831cd7 (diff) | |
| download | zig-32c90cb5539c3b340ae1b0b13d2b1521ebb6b1b0.tar.gz zig-32c90cb5539c3b340ae1b0b13d2b1521ebb6b1b0.zip | |
stage2: fix handling of aggregates with mixed comptime-only fields
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 188c2f6f11..bda81711fb 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -9185,7 +9185,7 @@ fn isByRef(ty: Type) bool { .AnyFrame, => return false, - .Array, .Frame => return ty.hasRuntimeBitsIgnoreComptime(), + .Array, .Frame => return ty.hasRuntimeBits(), .Struct => { // Packed structs are represented to LLVM as integers. if (ty.containerLayout() == .Packed) return false; @@ -9204,7 +9204,7 @@ fn isByRef(ty: Type) bool { var count: usize = 0; const fields = ty.structFields(); for (fields.values()) |field| { - if (field.is_comptime or !field.ty.hasRuntimeBitsIgnoreComptime()) continue; + if (field.is_comptime or !field.ty.hasRuntimeBits()) continue; count += 1; if (count > max_fields_byval) return true; @@ -9212,7 +9212,7 @@ fn isByRef(ty: Type) bool { } return false; }, - .Union => return ty.hasRuntimeBitsIgnoreComptime(), + .Union => return ty.hasRuntimeBits(), .ErrorUnion => return isByRef(ty.errorUnionPayload()), .Optional => { var buf: Type.Payload.ElemType = undefined; |
