From d5da2a6114926fae44f31eeab0706578f090dca8 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Tue, 22 Nov 2022 01:19:50 +0200 Subject: Sema: implement tuple declarations --- src/codegen/c.zig | 2 +- src/codegen/llvm.zig | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/c.zig b/src/codegen/c.zig index a06f8e76dd..5c459e7d9b 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -1791,7 +1791,7 @@ pub const DeclGen = struct { }, .Struct, .Union => |tag| if (tag == .Struct and t.containerLayout() == .Packed) try dg.renderType(w, t.castTag(.@"struct").?.data.backing_int_ty, kind) - else if (t.isTupleOrAnonStruct()) { + else if (t.isSimpleTupleOrAnonStruct()) { const ExpectedContents = struct { types: [8]Type, values: [8]Value }; var stack align(@alignOf(ExpectedContents)) = std.heap.stackFallback(@sizeOf(ExpectedContents), dg.gpa); diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index d34336701a..67073ac56e 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -1951,7 +1951,7 @@ pub const Object = struct { break :blk fwd_decl; }; - if (ty.isTupleOrAnonStruct()) { + if (ty.isSimpleTupleOrAnonStruct()) { const tuple = ty.tupleFields(); var di_fields: std.ArrayListUnmanaged(*llvm.DIType) = .{}; @@ -2885,7 +2885,7 @@ pub const DeclGen = struct { // reference, we need to copy it here. gop.key_ptr.* = try t.copy(dg.object.type_map_arena.allocator()); - if (t.isTupleOrAnonStruct()) { + if (t.isSimpleTupleOrAnonStruct()) { const tuple = t.tupleFields(); const llvm_struct_ty = dg.context.structCreateNamed(""); gop.value_ptr.* = llvm_struct_ty; // must be done before any recursive calls @@ -3579,7 +3579,7 @@ pub const DeclGen = struct { const field_vals = tv.val.castTag(.aggregate).?.data; const gpa = dg.gpa; - if (tv.ty.isTupleOrAnonStruct()) { + if (tv.ty.isSimpleTupleOrAnonStruct()) { const tuple = tv.ty.tupleFields(); var llvm_fields: std.ArrayListUnmanaged(*llvm.Value) = .{}; defer llvm_fields.deinit(gpa); @@ -10247,7 +10247,7 @@ fn llvmFieldIndex( var offset: u64 = 0; var big_align: u32 = 0; - if (ty.isTupleOrAnonStruct()) { + if (ty.isSimpleTupleOrAnonStruct()) { const tuple = ty.tupleFields(); var llvm_field_index: c_uint = 0; for (tuple.types) |field_ty, i| { @@ -10810,7 +10810,7 @@ fn isByRef(ty: Type) bool { .Struct => { // Packed structs are represented to LLVM as integers. if (ty.containerLayout() == .Packed) return false; - if (ty.isTupleOrAnonStruct()) { + if (ty.isSimpleTupleOrAnonStruct()) { const tuple = ty.tupleFields(); var count: usize = 0; for (tuple.values) |field_val, i| { -- cgit v1.2.3