aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 558556f108..6f240b88f5 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -2214,11 +2214,16 @@ pub const Object = struct {
));
}
- const union_name = if (layout.tag_size == 0) name.ptr else "AnonUnion";
+ var union_name_buf: ?[:0]const u8 = null;
+ defer if (union_name_buf) |buf| gpa.free(buf);
+ const union_name = if (layout.tag_size == 0) name else name: {
+ union_name_buf = try std.fmt.allocPrintZ(gpa, "{s}:Payload", .{name});
+ break :name union_name_buf.?;
+ };
const union_di_ty = dib.createUnionType(
compile_unit_scope,
- union_name,
+ union_name.ptr,
null, // file
0, // line
ty.abiSize(target) * 8, // size in bits