Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

DIFlags

Public Struct
std.zig.llvm.Builder.Metadata.DIFlags
pub const DIFlags = packed struct(u32)

Fields

Visibility: enum(u2) { Zero, Private, Protected, Public } = .Zero
FwdDecl: bool = false
AppleBlock: bool = false
ReservedBit4: u1 = 0
Virtual: bool = false
Artificial: bool = false
Explicit: bool = false
Prototyped: bool = false
ObjcClassComplete: bool = false
ObjectPointer: bool = false
Vector: bool = false
StaticMember: bool = false
LValueReference: bool = false
RValueReference: bool = false
ExportSymbols: bool = false
Inheritance: enum(u2) { Zero, SingleInheritance, MultipleInheritance, VirtualInheritance, } = .Zero
IntroducedVirtual: bool = false
BitField: bool = false
NoReturn: bool = false
ReservedBit21: u1 = 0
TypePassbyValue: bool = false
TypePassbyReference: bool = false
EnumClass: bool = false
Thunk: bool = false
NonTrivial: bool = false
BigEndian: bool = false
LittleEndian: bool = false
AllCallsDescribed: bool = false
Unused: u2 = 0

Functions

pub fn format(self: DIFlags, w: *Writer) Writer.Error!void

File

zig/llvm/Builder.zig:9308
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
    pub const DIFlags = packed struct(u32) {
        Visibility: enum(u2) { Zero, Private, Protected, Public } = .Zero,
        FwdDecl: bool = false,
        AppleBlock: bool = false,
        ReservedBit4: u1 = 0,
        Virtual: bool = false,
        Artificial: bool = false,
        Explicit: bool = false,
        Prototyped: bool = false,
        ObjcClassComplete: bool = false,
        ObjectPointer: bool = false,
        Vector: bool = false,
        StaticMember: bool = false,
        LValueReference: bool = false,
        RValueReference: bool = false,
        ExportSymbols: bool = false,
        Inheritance: enum(u2) {
            Zero,
            SingleInheritance,
            MultipleInheritance,
            VirtualInheritance,
        } = .Zero,
        IntroducedVirtual: bool = false,
        BitField: bool = false,
        NoReturn: bool = false,
        ReservedBit21: u1 = 0,
        TypePassbyValue: bool = false,
        TypePassbyReference: bool = false,
        EnumClass: bool = false,
        Thunk: bool = false,
        NonTrivial: bool = false,
        BigEndian: bool = false,
        LittleEndian: bool = false,
        AllCallsDescribed: bool = false,
        Unused: u2 = 0,

        pub fn format(self: DIFlags, w: *Writer) Writer.Error!void {
            var need_pipe = false;
            const info = @typeInfo(DIFlags).@"struct";
            inline for (info.field_names, info.field_types) |field_name, field_type| {
                switch (@typeInfo(field_type)) {
                    .bool => if (@field(self, field_name)) {
                        if (need_pipe) try w.writeAll(" | ") else need_pipe = true;
                        try w.print("DIFlag{s}", .{field_name});
                    },
                    .@"enum" => if (@field(self, field_name) != .Zero) {
                        if (need_pipe) try w.writeAll(" | ") else need_pipe = true;
                        try w.print("DIFlag{s}", .{@tagName(@field(self, field_name))});
                    },
                    .int => assert(@field(self, field_name) == 0),
                    else => @compileError("bad field type: " ++ field_name ++ ": " ++
                        @typeName(field_type)),
                }
            }
            if (!need_pipe) try w.writeByte('0');
        }
    }