sanitize qualified name for nvptx backend
This commit is contained in:
committed by
Andrew Kelley
parent
92a857b76c
commit
aad983cf40
@@ -720,6 +720,15 @@ pub const Decl = struct {
|
||||
var buffer = std.ArrayList(u8).init(mod.gpa);
|
||||
defer buffer.deinit();
|
||||
try decl.renderFullyQualifiedName(mod, buffer.writer());
|
||||
|
||||
// Sanitize the name for nvptx which is more restrictive.
|
||||
if (mod.comp.bin_file.options.target.cpu.arch.isNvptx()) {
|
||||
for (buffer.items) |*byte| switch (byte.*) {
|
||||
'{', '}', '*', '[', ']', '(', ')', ',', ' ', '\'' => byte.* = '_',
|
||||
else => {},
|
||||
};
|
||||
}
|
||||
|
||||
return buffer.toOwnedSliceSentinel(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user