mirror of
https://github.com/ziglang/zig.git
synced 2025-12-30 10:03:21 +00:00
spirv: add names to globals and initializers
This commit is contained in:
parent
924235a023
commit
decdedf97d
@ -1502,7 +1502,6 @@ pub const DeclGen = struct {
|
||||
try self.spv.addFunction(spv_decl_index, self.func);
|
||||
|
||||
const fqn = ip.stringToSlice(try decl.getFullyQualifiedName(self.module));
|
||||
|
||||
try self.spv.sections.debug_names.emit(self.gpa, .OpName, .{
|
||||
.target = decl_id,
|
||||
.name = fqn,
|
||||
@ -1578,6 +1577,19 @@ pub const DeclGen = struct {
|
||||
try self.spv.addFunction(spv_decl_index, self.func);
|
||||
|
||||
try self.spv.initializers.append(self.spv.gpa, initializer_id);
|
||||
|
||||
const fqn = ip.stringToSlice(try decl.getFullyQualifiedName(self.module));
|
||||
try self.spv.sections.debug_names.emit(self.gpa, .OpName, .{
|
||||
.target = decl_id,
|
||||
.name = fqn,
|
||||
});
|
||||
|
||||
const init_name = try std.fmt.allocPrint(self.gpa, "initializer of {s}", .{fqn});
|
||||
defer self.gpa.free(init_name);
|
||||
try self.spv.sections.debug_names.emit(self.gpa, .OpName, .{
|
||||
.target = initializer_id,
|
||||
.name = init_name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user