aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-09-20 21:19:29 +0100
committerAndrew Kelley <andrew@ziglang.org>2023-09-21 14:48:40 -0700
commitada83fa55773c8f8ff1bc2643c6525c3dfe871bf (patch)
treede2c912fbe4f95d331b69b9c184e998b2d85ed08 /src/codegen/llvm.zig
parent0182b7242e216ea6eabf465e32b7da60ad32ee2d (diff)
downloadzig-ada83fa55773c8f8ff1bc2643c6525c3dfe871bf.tar.gz
zig-ada83fa55773c8f8ff1bc2643c6525c3dfe871bf.zip
compiler: get codegen of behavior tests working on at least one backend
We're hitting false compile errors, but this is progress!
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 3ffe77e305..ebcdb82887 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -2504,6 +2504,7 @@ pub const Object = struct {
var it = struct_type.iterateRuntimeOrder(ip);
while (it.next()) |field_index| {
const field_ty = field_types[field_index].toType();
+ if (!field_ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
const field_size = field_ty.abiSize(mod);
const field_align = mod.structFieldAlignment(
struct_type.fieldAlign(ip, field_index),
@@ -3306,6 +3307,7 @@ pub const Object = struct {
var it = struct_type.iterateRuntimeOrder(ip);
while (it.next()) |field_index| {
const field_ty = struct_type.field_types.get(ip)[field_index].toType();
+ if (!field_ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
const field_align = mod.structFieldAlignment(
struct_type.fieldAlign(ip, field_index),
field_ty,
@@ -4016,10 +4018,11 @@ pub const Object = struct {
var need_unnamed = false;
var field_it = struct_type.iterateRuntimeOrder(ip);
while (field_it.next()) |field_index| {
- const field_ty = struct_type.field_types.get(ip)[field_index];
+ const field_ty = struct_type.field_types.get(ip)[field_index].toType();
+ if (!field_ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
const field_align = mod.structFieldAlignment(
struct_type.fieldAlign(ip, field_index),
- field_ty.toType(),
+ field_ty,
struct_type.layout,
);
big_align = big_align.max(field_align);
@@ -4045,7 +4048,7 @@ pub const Object = struct {
need_unnamed = true;
llvm_index += 1;
- offset += field_ty.toType().abiSize(mod);
+ offset += field_ty.abiSize(mod);
}
{
const prev_offset = offset;