inline fn specialized(
formatter: *Formatter,
distinct: enum formatter: *Formatterdistinct: enum { @"!", @"distinct !" }node: enum { DIFile, DICompileUnit, DISubprogram, DILexicalBlock, DILocation, DIBasicType, DICompositeType, DIDerivedType, DISubroutineType, DIEnumerator, DISubrange, DILocalVariable, DIGlobalVariable, DIGlobalVariableExpression, }nodesw: *Writer9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833 inline fn specialized(
formatter: *Formatter,
distinct: enum { @"!", @"distinct !" },
node: enum {
DIFile,
DICompileUnit,
DISubprogram,
DILexicalBlock,
DILocation,
DIBasicType,
DICompositeType,
DIDerivedType,
DISubroutineType,
DIEnumerator,
DISubrange,
DILocalVariable,
DIGlobalVariable,
DIGlobalVariableExpression,
},
nodes: anytype,
w: *Writer,
) !void {
const names = @typeInfo(@TypeOf(nodes)).@"struct".field_names;
comptime var fmt_str: []const u8 = "{[distinct]s}{[node]s}(";
inline for (names) |name| fmt_str = fmt_str ++ "{[" ++ name ++ "]f}";
fmt_str = fmt_str ++ ")\n";
const field_names = @as([]const []const u8, &.{ "distinct", "node" }) ++ names;
comptime var field_types: [2 + names.len]type = undefined;
@memset(field_types[0..2], []const u8);
@memset(field_types[2..], std.fmt.Alt(FormatData, format));
var fmt_args: @Struct(.auto, null, field_names, &field_types, &@splat(.{})) = undefined;
fmt_args.distinct = @tagName(distinct);
fmt_args.node = @tagName(node);
inline for (names) |name| @field(fmt_args, name) = try formatter.fmt(
name ++ ": ",
@field(nodes, name),
null,
);
try w.print(fmt_str, fmt_args);
}