aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-03-01 23:46:57 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-03-01 23:46:57 -0700
commited2364a1480f99a7380285cec15ff1962d9df519 (patch)
treeda488724987e43e11a5938589a9df5b92c79d8c4 /src/codegen
parent6f303c01f3e06fe8203563065ea32537f6eff456 (diff)
downloadzig-ed2364a1480f99a7380285cec15ff1962d9df519.tar.gz
zig-ed2364a1480f99a7380285cec15ff1962d9df519.zip
stage2: introduce anonymous struct literals
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 28654b905a..fa29a1aae3 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -958,7 +958,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.isTuple()) {
+ if (t.isTupleOrAnonStruct()) {
const tuple = t.tupleFields();
const llvm_struct_ty = dg.context.structCreateNamed("");
gop.value_ptr.* = llvm_struct_ty; // must be done before any recursive calls
@@ -2104,7 +2104,7 @@ pub const DeclGen = struct {
var zig_big_align: u32 = 0;
var llvm_big_align: u32 = 0;
- if (ty.isTuple()) {
+ if (ty.isTupleOrAnonStruct()) {
const tuple = ty.tupleFields();
var llvm_field_index: c_uint = 0;
for (tuple.types) |field_ty, i| {
@@ -5704,7 +5704,7 @@ fn isByRef(ty: Type) bool {
.Struct => {
// Packed structs are represented to LLVM as integers.
if (ty.containerLayout() == .Packed) return false;
- if (ty.isTuple()) {
+ if (ty.isTupleOrAnonStruct()) {
const tuple = ty.tupleFields();
var count: usize = 0;
for (tuple.values) |field_val, i| {