authorgravatar for david@vortan.devDavid Rubin <david@vortan.dev> 2024-08-12 15:20:52-07:00
committergravatar for david@vortan.devDavid Rubin <david@vortan.dev> 2024-08-25 15:17:41-07:00
log472f3ac419386327a3ed464256509af456092785
tree0ff70a8295ea0bc9a61d7f46c91c170a41b29120
parent1c1feba08edf1ded85af0ec003939a7756f4ab0b
signaturelock-open Commit is signed but in an unrecognized format.

zcu: add some documentation around `Zcu.Feature`


1 files changed, 13 insertions(+), 0 deletions(-)

src/Zcu.zig+13
...@@ -2923,10 +2923,23 @@ pub fn addGlobalAssembly(zcu: *Zcu, cau: InternPool.Cau.Index, source: []const u...@@ -2923,10 +2923,23 @@ pub fn addGlobalAssembly(zcu: *Zcu, cau: InternPool.Cau.Index, source: []const u
2923}2923}
29242924
2925pub const Feature = enum {2925pub const Feature = enum {
2926 /// When this feature is enabled, Sema will emit calls to `std.builtin.panic`
2927 /// for things like safety checks and unreachables. Otherwise traps will be emitted.
2926 panic_fn,2928 panic_fn,
2929 /// When this feature is enabled, Sema will emit calls to `std.builtin.panicUnwrapError`.
2930 /// This error message requires more advanced formatting, hence it being seperate from `panic_fn`.
2931 /// Otherwise traps will be emitted.
2927 panic_unwrap_error,2932 panic_unwrap_error,
2933 /// When this feature is enabled, Sema will emit calls to the more complex panic functions
2934 /// that use formatting to add detail to error messages. Similar to `panic_unwrap_error`.
2935 /// Otherwise traps will be emitted.
2928 safety_check_formatted,2936 safety_check_formatted,
2937 /// When this feature is enabled, Sema will insert tracer functions for gathering a stack
2938 /// trace for error returns.
2929 error_return_trace,2939 error_return_trace,
2940 /// When this feature is enabled, Sema will emit the `is_named_enum_value` AIR instructions
2941 /// and use it to check for corrupt switches. Backends currently need to implement their own
2942 /// logic to determine whether an enum value is in the set of named values.
2930 is_named_enum_value,2943 is_named_enum_value,
2931 error_set_has_value,2944 error_set_has_value,
2932 field_reordering,2945 field_reordering,