mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
llvm: fix untagged struct names in debug info for llvm (again)
At least lldb misbehaves with all these same-named unions, so just generate a unique name.
This commit is contained in:
parent
f6c9346773
commit
9e51972701
1 changed files with 7 additions and 2 deletions
|
|
@ -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(
|
const union_di_ty = dib.createUnionType(
|
||||||
compile_unit_scope,
|
compile_unit_scope,
|
||||||
union_name,
|
union_name.ptr,
|
||||||
null, // file
|
null, // file
|
||||||
0, // line
|
0, // line
|
||||||
ty.abiSize(target) * 8, // size in bits
|
ty.abiSize(target) * 8, // size in bits
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue